I want to get the reverse of the 5 digit number but i'm not getting it. I don't know where is the problem.I'm a beginer.In my book book there is a similar kind of problem where it's mentioned that the input value should be less than 32767.my question is why? and the second thing is if i choose any number less than 32767, still i'm not geting the answer.Do I have to choose a value where the reverse number is also less than 32767.please tell me.
#include<stdio.h>
#include<conio.h>
int main()
{
int num,a,b;
int total=0;
printf("Enter a 5 digit number: ");
scanf("%d",&num);
a=num%10;
b=num/10;
total=total+a*10000;
a=b%10;
b=b/10;
total=total+a*1000;
a=b%10;
b=b/10;
total=total+a*100;
a=b%10;
b=b/10;
total=total+a*10;
a=b%10;
total=total+a;
printf("The desired value is:%d",total);
getch();
return 0;
}