Program for palindrome number (using loops). C
#include<stdio.h>
#include<conio.h>
void main()
{
int n,r,temp,sum=0;
printf("enter numbers= ");
scanf("%d",&n);
temp=n;
while(n>0)
{
r=n%10;
sum=(sum*10)+r;
n=n/10;
}
n=temp;
if(n==sum)
{
printf("palidrome number");
}
else
{
printf("not a palidrome");
}
getch();
}
Comments
Post a Comment