Q. What is the output of this loop?
Code:
int i = 0;
do {
printf("%d ", i);
i++;
} while(i < 3);
β
Correct Answer: (A)
0 1 2
Explanation: do-while loop prints 0, 1, and 2 before i becomes 3 and exits.