Tech Mahindra interview question

Basic Programming and behavioral question