Testing.

Sunday, 22 January 2017

C programming language: C program to check given number is palindrome number or not.


#include<stdio.h>
#include<conio.h>
void main()
{
int num,rem,sum=0,n;
printf("\nEnter Number To Check: ");
scanf("%d",&num);
n=num;
   while(num)
   {
     rem=num%10;
     sum=sum*10+rem;
     num=num/10;
   }
if(n==sum)
printf("\n%d Is Palindrome: ",n);
else
printf("\n%d Is Not palindrome:",n);
getch();
}

No comments:

Post a Comment