int ans = 0;
int i = a;
while (__________________________ ) { // fill in the loop predicate
i = i - b
ans = ans + 1
}
// ans is now a/b
The code is supposed to compute ans as the int result of
dividing a by b.
You should show your loop invariant to the instructor before proceeding, to be sure that you have a proper loop invariant
Check this with the instructor too.
Submit the above to the instructor with your name and the last 3 digits of your student ID.You will be asked to explain steps of your proof, so you better understand what you write if you want to get credit for it.