Question
Select the output for the following set of code :
static void Main(string[] args) { int i = 9 , j = 7; switch (i - j + 3) { case 9: 7: j += 6; break; case 5: i -= 4; break; } Console.WriteLine(i + "\n" + j); Console.ReadLine(); }
static void Main(string[] args) { int i = 9 , j = 7; switch (i - j + 3) { case 9: 7: j += 6; break; case 5: i -= 4; break; } Console.WriteLine(i + "\n" + j); Console.ReadLine(); }
Answer: Option C
Was this answer helpful ?
Invalid expression'7:' in case 9:7:.
Was this answer helpful ?
Submit Solution