Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace MySwitchScript
- {
- class MySwitchStatement
- {
- public static void Main(string[] args)
- {
- int num;
- Console.WriteLine("Enter a number between 0-9");
- switch
- {
- case '0':
- Console.WriteLine("Even");
- break;
- case '1':
- Console.WriteLine("Odd");
- break;
- case '2':
- Console.WriteLine("Even");
- break;
- case '3':
- Console.WriteLine("Odd");
- break;
- case '4':
- Console.WriteLine("Even");
- break;
- case '5':
- Console.WriteLine("Odd");
- break;
- case '6':
- Console.WriteLine("Even");
- break;
- case '7':
- Console.WriteLine("Odd");
- break;
- case '8':
- Console.WriteLine("Even");
- break;
- case '9':
- Console.WriteLine("Odd");
- break;
- if else:
- Console.WriteLine("Please re-enter your input.")
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement