Basic looping mechanisms in C