Amdocs interview question

A small coding question inc++