187k views
5 votes
QUESTION 3 Which of the following for loop headers will cause the body of the loop to be executed 100 times? a. for(int i = 0; i <= 100; i++) b. for(int i = 1; i < 100; i++) c. for(int i = 1; i <= 101; i++) d. for(int i = 0; i < 100; i++) e. none of these for loops will execute the loop body 100 times

User Leo Liu
by
6.8k points

2 Answers

1 vote

Answer:

0 + 10i

Step-by-step explanation:

just did it on edge 2020

User Lasana
by
5.8k points
3 votes

Answer: a

Step-by-step explanation:

for(int i = 1; i <= 100; i++)

means the execution start from 1 that is i=1 and execution will stop at 100 dot.

the loop will test the statement, if the statement is true it will execute and go to the next(that is increment by 1).

User Cyang
by
6.1k points