Subj : Re: Reversing a number To : comp.programming From : Steve O'Hara-Smith Date : Mon Sep 12 2005 11:52 am On Sun, 11 Sep 2005 11:24:12 +0100 Gerry Quinn wrote: > In article <4323ae19.7955343@news.individual.net>, alfps@start.no > says... > > * deanfamily11: > > > I need to write a function that takes an integer as a parameter and then > > > returns it reversed (i.e. input: 45678, returned: 87654). > > Convert it to a string, reverse the string, convert it to a number. When I was learning programming one example was converting an integer to a string - it was pointed out that it was very easy to convert an integer to a string of digits in reverse order and fixing the order was used to introduce recursion. -- C:>WIN | Directable Mirror Arrays The computer obeys and wins. | A better way to focus the sun You lose and Bill collects. | licences available see | http://www.sohara.org/ .