Home / MCQ Bank / Computer
Computer Control Flow Statements In C Sharp

What will be the output of the following C# code? static void Main(string[] args) { int i; i = 0; while (i++ < 5) { Console.WriteLine(i); } Console.WriteLine("\n"); i = 0; while ( ++i < 5) { Console.WriteLine(i); } Console.ReadLine(); }

Select the best option to verify your answer:
Show Correct Answer
Correct Answer: Option C • 1 2 3 4 5 1 2 3 4

Related Computer Questions

How can you link a table with another so that a field in current table will display values in drop down box from another table while entering data: What is the purpose of the `KeyEventDispatcher` interface in Java event handling? Which of the following algorithms uses a stack to store its function calls? How do you create a histogram in ggplot2 for a numeric variable named variable? You have a Command button in the Form Footer, you click the Tabular Control Layout; an attached label will be added in what section?