hey,, i'm joyce, newbie.. I am very stuck in this problem,, had been on it in days. I've tried many prgrams but none seemed to work properly.
the objective is to use a function that displays a reversed version of a long integer. e.g. 12345 then display 54321.
Out of all the programs i did, i think this is the 'best' of the worst...
#include <stdio.h>
#include <conio.h>
int reverse(int num)
{
long sum=0;
int rem;
while (num=0)
{
rem=num%10;
sum=sum*10+rem;
num=num/10;
return (sum);
}
main()
{
int num, sum;
printf ("enter a no. to be reversed:");
scanf ("%d", &num);
reverse(int num);
printf ("%d", sum);
getche();
}
im sorry if i doubled stuff because i am both new to functions and forums,,, please,, i need help. IF I DON'T GET HELP, I'M GONNA FAIL COMPUTER SCIENCE...............