Subj : Re: Reversing a number To : comp.programming From : Willem Date : Sun Sep 11 2005 10:36 pm Roger wrote: ) "Irrwahn Grausewitz" wrote in message ) news:shv7i1p3on0qpsr2rumeifst69o8tjtp32@4ax.com... )> But why treat the first iteration as a special case? )> Just replace the two lines above with: )> )> int n = 0; )> )>> while (i) )>> { )>> n *= 10; )>> n += i % 10; )>> i /= 10; )>> } )>> return n; )>>} ) ) Then reverse(10000) is (1). Of course it is; the function returns an integer, after all. SaSW, Willem -- Disclaimer: I am in no way responsible for any of the statements made in the above text. For all I know I might be drugged or something.. No I'm not paranoid. You all think I'm paranoid, don't you ! #EOT .