65. Mode Selection Enum

 Your task is to declare a scoped enum class named Mode with four values:

  • Input
  • Output
  • PullUp
  • PullDown
     

Also, implement a function named toString(Mode m) that returns "INPUT", "OUTPUT", "PULLUP", or "PULLDOWN" string.

The program will read an integer (0..3), map it to the enum, and print the corresponding mode.

 

Example
 Input:

0

Output:

INPUT

 

Input:

2

Output:

PULLUP

 

Loading...

Input

0

Expected Output

INPUT