Added hwk4 (using loop invariant with C)