If aValue, i, and n are type int variables, what does the following program
fragment do?
aValue = 0; n = 10;
for (i = n; i > 0; i--)
if (i % 2 == 0)
aValue = aValue + i;
a. computes the sum of the integers from 1 through n
b. computes the sum of the integers from 1 through n - 1
c. computes the sum of the even integers from 1 through n
d. computes the sum of the odd integers from 1 through n
e. none of the above
Sorry the answer is not available at the moment…
If you are able to find the answer, please make sure to post it here. So that your Juniors have smile on their lips and feel happy.
Spread the 'tradition of sharing'.