Caterpillar interview question

c,c++