Consider the same Do While loop in question 4 above to answer the following questions:
(a) How many times the loop condition is tested?
(b) How many times the body of the Do While loop is executed?
(c) What is the final value of intSum and intCount variables after the loop ends?
(a) How many times the loop condition is tested?
17 times the loop condition is tested
(b) How many times the body of the Do While loop is executed?
Answer:
16 times the body of the Do While loop is executed
(c) What is the final value of intSum and intCount variables after the loop ends?
Answer:
The Sum is: 105
The intCount is: 16
Comments