Preview
C program to check whether a number is palindrome or not.
#include<stdio.h>
#include<conio.h>
void main()
{
int m,n,r,t;
printf(“\nEnter a number:=”);
scanf(“%d”,&n); //n=1221
t=n; //t=1221
r=0;
while(n>0)
{
m=n%10;
r=r*10+m;
n=n/10;
} //r=1221
if(t==r)
printf(“\nNumber is palendrome”);
else
printf(“\nNumber is not palendrome”);
getch();
}
Popular Books of Computer Science