A

Admin • 34.37K Points
Instructor I

Q. How many times do we get through the following loop?

Code:
for ( counter = 2; counter < 9; counter += 2 )
  • (A) 4
  • (B) 5
  • (C) 7
  • (D) 8
From 2 to 9 with Step = 2. So we get through the loop 4 times. (2 -> 4 -> 6 -> 8).

You must be Logged in to update hint/solution

Discusssion

Login to discuss.