A

Admin • 833K Points
Coach

Q. What is the output of this code?

Code:
int main() {
int a = 5, b = 10;
while (a < b) {
printf("%d ", a);
a++;
}
return 0;
}
  • (A) 5 6 7 8 9
  • (B) 6 7 8 9 10
  • (C) 5 6 7 8 9 10
  • (D) None
  • Correct Answer - Option(A)
  • Views: 18
  • Filed under category C Programming
  • Hashtags:

Explanation by: Admin

The loop prints numbers from 5 to 9; when a becomes 10, the loop exits.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.