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
Leave a comment