Vidyalelo
C# Programming · Q34

Control Flow Statements in C Sharp

Programming · C# Programming · question 34

Q34

What will be the output of the following C# code? static void Main(string[] args) char ch = 'p'; switch (ch) case 'p': Console.WriteLine("coco" + " " + Convert.ToInt32(ch)); break; default: Console.WriteLine("default"); break; Console.WriteLine("main");

A.
coco main
B.
coco 112
C.
coco 112 main
Answer
D.
compile time error

Answer: Option C

Solution

Answer: Option C
No explanation is given for this question Let's Discuss on Board