Amazon interview question

code in C a simple program