What is the 5 casé of gotham city? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is the 5 casé of gotham city?

Hi, this is my code and I don't know the last test case. Tk for the advice namespace SoloLearn { class Program { static void Main(string[] args) { int numeroCriminales; numeroCriminales = Convert.ToInt32(Console.ReadLine()); switch (numeroCriminales) { case 0: { Console.WriteLine("Nothing to do"); break; } case object _ when 1 <= numeroCriminales && numeroCriminales <= 4: { Console.WriteLine("I got this!"); break; } case object _ when 5 <= numeroCriminales && numeroCriminales <= 10: { Console.WriteLine("Help me Batman"); break; } default: { Console.WriteLine("Good Luck out there!"); break; } } } } }

4th May 2020, 2:48 AM
Javier Bahamón
Javier Bahamón - avatar
1 Answer
+ 1
you could use if else statements if ( x < 5 ) { } else if( x <= 10) { } else if( x > 10){ }
4th May 2020, 4:45 AM
Bahhaⵣ
Bahhaⵣ - avatar