Report Bug
Qus :

What will be the output of the following JavaScript code?

let i = 0;
while(i < 3) {
  console.log(i);
  i++;
}

Qus

निम्नलिखित जावास्क्रिप्ट कोड का आउटपुट क्या होगा?

let i = 0;
while(i < 3) {
  console.log(i);
  i++;
}


A. 0 1 2
B. 1 2 3
C. 0 1 2 3
D. 1 2


Solution
A. 0 1 2



Explanation
The loop starts at i = 0 and runs while i < 3. It increments i after each iteration, printing 0, 1, and 2.



Report Bug