Tech Mahindra interview question

Functions, loops