Question: How many iterations do the following loops carry out? Assume that i is not changed in the loop body. a. for (int i = 1;
How many iterations do the following loops carry out? Assume that i is not changed in the loop body.
a. for (int i = 1; i <= 10; i++) . . .
b. for (int i = 0; i < 10; i++) . . .
c. for (int i = 10; i > 0; i--) . . .
d. for (int i = -10; i <= 10; i++) . . .
e. for (int i = 10; i >= 0; i++) . . .
f. for (int i = -10; i <= 10; i = i + 2) . . .
g. for (int i = -10; i <= 10; i = i + 3) . . .
Step by Step Solution
3.38 Rating (157 Votes )
There are 3 Steps involved in it
aforint i1 i 0i Number of iterations10 ... View full answer
Get step-by-step solutions from verified subject matter experts
