1.

Does testing the loop condition affect the loop invariant? Why?

Answer»

No, the loop condition do not affect the loop invariant.

Because the loop invariant is true at four points.

1. At the start of loop.

2. At the start of each iteration.

3. At the end of each iteration.

4. At the end of the loop.



Discussion

No Comment Found