Tech Mahindra interview question

Program to explain inheritance concepts.