2 problems written in C language