IBM interview question

Coding questions were basic level from C/C++