For and While loops in C