//Program to check whether the user entered integer/number is Palindrome
#include<stdio.h>
#include<conio.h>
int main()
{
int a,b,c,d,e;
long int f,g,h;
clrscr();
printf("Enter a Five Digit number ");
scanf("%d",&a);
h=a;
b=a/10000;a=a%10000;
c=a/1000;a=a%1000;
d=a/100;a=a%100;
e=a/10;a=a%10;
f=a;
f=f*10000;
e=e*1000;
d=d*100;
c=c*10;
g=b+c+d+e+f;
if(h==g)
printf("Number is palindrome",g);
else printf("Number is not palindrome");
getch();
return 0;
}
To Run this Program Copy it in text editor and save as .c
Then double click on it and then it will get opened in your compiler.
Click on run.
#include<stdio.h>
#include<conio.h>
int main()
{
int a,b,c,d,e;
long int f,g,h;
clrscr();
printf("Enter a Five Digit number ");
scanf("%d",&a);
h=a;
b=a/10000;a=a%10000;
c=a/1000;a=a%1000;
d=a/100;a=a%100;
e=a/10;a=a%10;
f=a;
f=f*10000;
e=e*1000;
d=d*100;
c=c*10;
g=b+c+d+e+f;
if(h==g)
printf("Number is palindrome",g);
else printf("Number is not palindrome");
getch();
return 0;
}
To Run this Program Copy it in text editor and save as .c
Then double click on it and then it will get opened in your compiler.
Click on run.