Texas Instruments interview question

Programming questions c and Java