Q. How many times do we get through the following loop?
Code:
for ( counter = 2; counter < 9; counter += 2 )
β
Correct Answer: (A)
4
Explanation: From 2 to 9 with Step = 2. So we get through the loop 4 times. (2 -> 4 -> 6 -> 8).