SOURCE CODE:
#include<stdio.h>
#include<conio.h>
void main()
{
long int n,temp,a,sum=0;
clrscr();
printf("Enter number:");
scanf("%ld",&n);
temp=n;
while(n>0)
{
a=n%10;
sum=sum*10+a;
n/=10;
}
if(temp==sum)
{
printf("\n%ld is palindrom.",temp);
}
else
{
printf("\n%ld is not palingrom.",temp);
}
getch();
}
#include<stdio.h>
#include<conio.h>
void main()
{
long int n,temp,a,sum=0;
clrscr();
printf("Enter number:");
scanf("%ld",&n);
temp=n;
while(n>0)
{
a=n%10;
sum=sum*10+a;
n/=10;
}
if(temp==sum)
{
printf("\n%ld is palindrom.",temp);
}
else
{
printf("\n%ld is not palingrom.",temp);
}
getch();
}
No comments :
Post a Comment