+ 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?

12th Jun 2019, 9:18 AM
Ryhxs
Ryhxs - avatar
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
12th Jun 2019, 11:10 AM
HNNX 🐿
HNNX 🐿 - avatar
+ 1
Ok, thx!
12th Jun 2019, 11:11 AM
Ryhxs
Ryhxs - avatar