Amdocs interview question

Write code for reverse number