"Alves, Carlos Alberto - Coelce" <calves at coelce.com.br> writes: > Yeah, it works. But not for n=0, when we get the wrong result '' intead '0'. The representation of 0 as '0' is a special case. You'll either have to write special-case code for it or convert your recursive while loop into a recursive do-while loop that always executes at least once.