Amdocs interview question

simple c programing code as i was fresher