HCLTech Interview Question

Related to java and c