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
πŸ’¬ Discuss
βœ… Correct Answer: (B) 1 2 3
Explanation: i is incremented after comparison, so loop prints 1 2 3.
Explanation by: Mr. Dubey
i is incremented after comparison, so loop prints 1 2 3.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
53
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
94%
Success Rate