Société Générale interview question

some syntax questions and one algorithm question in c++