MCQs > IT & Programming > C# > What will happen if the value of nNum is 2 and the following code is compiled and executed? switch(nNum) { case 1: Console.WriteLine('nNum = 1'); break; case 2: Console.WriteLine('nNum = 2'); default: Console.WriteLine('nNum is not 1 nor 2'); break; }

C# MCQs

What will happen if the value of nNum is 2 and the following code is compiled and executed? switch(nNum) { case 1: Console.WriteLine("nNum = 1"); break; case 2: Console.WriteLine("nNum = 2"); default: Console.WriteLine("nNum is not 1 nor 2"); break; }

Answer

Correct Answer: Compiler error

Explanation:

Note: This Question is unanswered, help us to find answer for this one

C# Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

C# Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it