Cognizant Interview Question

in c++