Question: 2. Now, create a new project and name its main class (and file) as SwitchStatement. Implement anothe version of the above program by writing the
2. Now, create a new project and name its main class (and file) as SwitchStatement. Implement anothe version of the above program by writing the following code. Console.WriteLine("Enter a number (as an integer): "); int number = Convert.ToInt32 (Console.ReadLine()); switch (number) { } case 1: Console.WriteLine("One"); break; break; case 2: Console.WriteLine("Two"); default: Console.WriteLine("Error: you must enter an integer between 1 and 9"); break; Console.ReadLine()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
