110k views
18 votes
What is wrong with this case statement -> case 2:

A. cases must be capitalized
B. cases must use a ; and not a :
C. nothing

1 Answer

1 vote

Answer:

C: Nothing

Step-by-step explanation:

Assuming this case is acting upon a switch on an integral value, there is nothing wrong with this case header.

var x = 10;

switch (x)

{

case 2:

Console.WriteLine("The value of 'x' is 2!");

}

User Lexandro
by
4.7k points