Tech Mahindra interview question

Few Technical Questions on C++ and Java