Tech Mahindra interview question

Add the even elements in array