Pergunta de entrevista da empresa Cognizant

Coding question where basic concepts of OOPs,loop are implemented