learning c and write the code