Cognizant interview question

in c++