Home / MCQ Bank / Computer
Computer Control Flow Statements In C Sharp Difficulty: Medium

What will be the output of the following C# code? static void Main(string[] args) { int i = 2, k = 3; switch (i - k) { case -1: ++i; ++k; break; case 2: --i; ++k; break; default: i += 3; k += i; break; } Console.WriteLine(i + "\n" + k); Console.ReadLine(); }

Select the correct option to test your answer:

More Computer Questions

Which option is true for viewing Profit & Loss A/C in Gateway of Tally What will be the output of the following C# code? int a,b; a = (b = 10) + 5; What will the max function in the numeric limit will return for type float? A small button with three dots usually displayed at the right of field properties box Which data structure is optimal for implementing a least frequently used (LFU) cache?