To check a number Palindrome number or not using C programming
just copy the bellow code and paste it to your TurboC software. And then run the program.
#include<stdio.h>
#include<conio.h>
void main()
{
int n,t,s=0,r;
clrscr();
printf("enter any number : ");
scanf("%d",&n);
t=n;
while(n>0)
{
r=n%10;
s=(s*10)+r;
n=n%10;
}
if(t==s)
printf("%d is palindrome number",t);
else
printf("%d is not palindrome number",t);
getch();
}
0 comments:
Post a Comment