HCL Interview Question

Any programming geek can solve it