Question discussion

How many times will the following loop execute?

358829Medium DSSSB TGT Computer Science 0 replies 0 views
0
How many times will the following loop execute?
for (int i = 0; i < 5; i++) {
    printf("%d ", i);
}
  • AInfinite
  • B4
  • C5
  • D6
Correct answer: C

Explanation

The loop runs for i = 0, 1, 2, 3 and 4, which is 5 times.

Discussion 0

Nobody has replied yet. Start the discussion!