Thursday, 19 December 2019

Palindrome Number in C

#include<stdio.h>
#include<conio.h>
int main()
{
int num,n,r,s=0;
printf("enter the number\n");
scanf("%d",&n);
num=n;
while(num>0)
{
r=num%10;
s=(s*10)+r;
num=num/10;
}
if(s==n)
printf("The number %d is Palindrome",n);
else
printf("The number %d is NOT Palindrome",n);
getch();
return 0;
}

No comments:

Post a Comment

Convey your thoughts to authors.