Infosys interview question

oops in c++