Reverse digit by using loops

This is the question.
Write a program that prompts the user to input a positive integer number and then output the number with the digit reversed.For example if the input is 45678, the output should be 87654.Your program must also ouput 8000 as 0008 and 230 as 032.
I dint have any idea for this question.Can anyone to help me and give me some idea about this question.Thanks.
Show us what you've done so far and where you are having troubles.
here's a hint, u can use strlen function to returns the length of string, and do looping from behind
example :

123456 -> length : 6
scan array, arr[0]=1,arr[1]=2,arr[2]=3,arr[3]=4,arr[4]=5,arr[5]=6
loop from (length-1) to 0 and print it
Thanks for your helping...i solve this problem already.but can you show me how to do repetition by using while loops?Thanks.
Post your working solution, then we can help you convert it to a while loop.
A simple modulus (remainder) and divide function will do what you want.
To use a while loop read your textbook.
Thanks for all your comment...I already solve it...Thanks a lot...
Last edited on
Topic archived. No new replies allowed.