integers in reverse with a function call
Greetings,
I really could use some insight if at all possible. I have to write a little program that has a function and takes a number in as an argurement and then returns it in reverse order, without using arrays. So if I enter "1234" at the prompt, I get back "4321".
Any ideas would be helpful....below is what i have so far and I have been working on this for 6 hours today...pls don't laugh, this is really hard stuff for me.
Thanks in advance for any ideas...
#include <stdio.h>
int reverse(int num)
{
/*reverse function here*/
return num;
}
main()
{
int num;
printf("Enter a four digit number>");
scanf("%d", &num);
reverse(num);
printf("num = %d\n", num);
getchar(); //temporary use for borland
getchar(); //temporary use for borland
}