+ 1
Case should be in order or not
Does it have to use Case 1: Case 2: Or just Case 46: Case 89: Does it have to be in order and can it use words instead of numbers?
2 ответов
+ 2
Not at all, case has no order.
switch (grade ) {
case e :
Console.WriteLine("print letter e"); break;
case f:
Console.WriteLine("print letter f"); break;
default:
Console.WriteLine(" no letter ");
break;
}
//this is how it looks in java/c# since I saw you did those two tutorials
+ 1
Ok, thx!