Cognizant interview question

Write codes of few programs