Write A Program to Check the given number is Palindrome or not
#include<stdio.h> #include<conio.h> main ( ) { int x, y, n , pal=0; printf (“enter x value “); scanf (“% d”, &...
https://www.computersprofessor.com/2016/06/write-program-to-check-given-number-is.html?m=0
#include<stdio.h>
#include<conio.h>
main ( )
{
int x, y, n , pal=0;
printf (“enter x value “);
scanf (“% d”, & x) ;
n=x;
while ( x > 0)
{
y = x%10;
pal = pal * 10 + y;
x = x/10;
}
if (pal = = n)
printf (“% d is palindrome”, n);
else
printf (“% d is not palindrome” n);
getch ( );
}
Out Put:
Enter x value
121
121 is
palindrome