0
The default case,you are making a game where the player select the directly level 1 easy, 2-medium3 hard you are given a program
Switch case
8 ответов
+ 2
Be clear about question and share your try!!.
https://www.sololearn.com/discuss/333866/?ref=app
+ 1
Your attempt?
+ 1
Am asking to share your try..
If you share it then it helps to find mistake in code if any.. Or what went wrong.. !
0
The default case
you are making a game where the player select the directly level 1 easy ,2 medium ,3 hard you are given a program that text the number as input complete the program so that it will output the corresponding difficulty level it if the user entire and invalid number the program should output "invalid option"
sample input -2
sample output - medium
use the default case to execute the invalid option message
0
Yes, but case3 and case 5 do not match
0
OK thanks
0
Console.WriteLine("Invalid option"); // Write capital I
0
switch (num) {
case 1:
Console.WriteLine("Easy");
break;
case 2:
Console.WriteLine("Medium");
break;
case 3:
Console.WriteLine("Hard");
break;
default:
Console.WriteLine("Invalid option");
break;
}