#include<stdio.h>
#include<conio.h>
void main()
{
int n1,n,s=0,a;
clrscr();
printf("Enter the number\n");
scanf("%d",&n);
n1=n;
while(n>0)
{
a=n%10;
n=n/10;
s=(10*s)+a;
}
if(n1==s)
printf("Given number is palindrome\n");
else
printf("Given number is not palindrome\n");
getch();
}
#include<conio.h>
void main()
{
int n1,n,s=0,a;
clrscr();
printf("Enter the number\n");
scanf("%d",&n);
n1=n;
while(n>0)
{
a=n%10;
n=n/10;
s=(10*s)+a;
}
if(n1==s)
printf("Given number is palindrome\n");
else
printf("Given number is not palindrome\n");
getch();
}
Comments
Post a Comment