Cognizant interview question

basic oops and c++ programming