Question:What will be the output of the following code?int x = 0; while (x < 3) { Console.WriteLine(x); x += 1; }
int x = 0; while (x < 3) { Console.WriteLine(x); x += 1; }
A 0 1 2 B 0 1 2 3 C 1 2 3 D 0 1
+ AnswerA
+ ExplanationThe loop runs while x is less than 3, printing 0, 1, and 2.
+ Report