Cognizant interview question

Different Program codes