Infosys Interview Question

Coding questions, they share some code snipets and want answer for them