HCLTech interview question

Related to java and c