Question Invariant True at the end of body of loop?? 

Forum: Com Sci 221, U Chicago, Autumn 2001, Old Classwork
Re: News Assignment #4 due Monday, 22 October (Mike O'Donnell)
Date: 2001, Oct 22
From: <agnostic98@hotmail.com>

I read in the book somewhere that an invariant needs to be true when the program enters the body of the loop AND if the program goes all the way to the end of the body, the invariant must also be true coming out. That means the only way to get out of the loop without the invariant being true is using a break, which we shouldn't use. So what do we do???


Messages

1. Feedback Keep the invariant true by Mike O'Donnell, 2001, Oct 22

to: "Invariant True at the end of body of loop??"