Have you gotten into a situation where it was hard to keep track of what is wrong with your Loop because the loop either runs forever without terminating or it gives results that were not expected? One way to leverage on your loops and show that your loops correctly give the desired result is to prove your loops with loop invariants.
What is a loop invariant
A loop invariant is a proof
@emeka_david