Menus

Wednesday 1 April 2020

Check whether a Number is Palindrome or Not - C Program


#include<stdio.h>

void main()
{

int n,m,a,r=0;

printf("Enter the number : ");
scanf("%d",&n);

m=n;

while(n>0)
{
a=n%10;
n=n/10;
r=r*10+a;
}


if(m==r)
 printf("%d is palindrome \n",m);
else
 printf("%d is not palindrome \n",m);

}




No comments:

Post a Comment