A

Admin • 833K Points
Coach

Q. What will be the output of this code?

Code:
int i = 0;
while (i++ < 3)
printf("%d ", i);
  • (A) 0 1 2
  • (B) 1 2 3
  • (C) 1 2 3 4
  • (D) 0 1 2 3
  • Correct Answer - Option(B)
  • Views: 22
  • Filed under category C Programming
  • Hashtags:

Explanation by: Admin

i is incremented after comparison, so loop prints 1 2 3.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.