Can somebody show me how to do this with steps? not understanding it, i have a test tomorrow!!
Determine the value in total after each of the following loops is executed:
a. total = 0;
for (i = 1; i <= 10; i = i + 1)
total = total + 1;
b. total = 1;
for (count = 1; count <= 10; count = count + 1)
total = total * 2;
c. total = 0
for (i = 10; i <= 15; i = i + 1)
total = total + i;
d. total = 50
for (i = 1; i <=10; i = i + 1)
total = total – i;
e. total = 1
for (icnt = 1; icnt <= 8; ++icnt)
total = total * icnt;
f. total = 1.0
for (j = 1; j <= 5; ++j)
total = total / 2.0;
Last edited on