Vidyalelo
C# Programming · Q88

Control Flow Statements in C Sharp

Programming · C# Programming · question 88

Q88

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(" "); i = 0; while ( ++i < 5) Console.WriteLine(i); Console.ReadLine();

A.
1 2 3 4
1 2 3 4 5
B.
1 2 3
1 2 3 4
C.
1 2 3 4 5
1 2 3 4
Answer
D.
1 2 3 4 5
1 2 3 4 5

Answer: Option C

Solution

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