working 4 lab C but with while (1)