Capgemini Interview Question

Question related to loop, operator,