Pregunta de entrevista de Continental

General programing questions, logic based