Domanda di colloquio di Virtusa

Some basic programming question and it's explanation