Pregunta de entrevista de Tata Consultancy Services

Logical question pertaining to programming