Infosys Interview Question

It's is completely on java and c