F A simple Palindrome program in c by using math function | CodeTheta

A simple Palindrome program in c by using math function

January 17, 2014


/* http://native-code.blogspot.com */

#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
int n,m,r,x=0,b;
printf("/* http://native-code.blogspot.com */ \n\n Enter the number: ");
scanf("%d",&n);
m=n;
while(n!=0)
{
r=n%10;
x=(x*10)+r;
n=n/10;
}
printf("the number is %d",m);
if(m==x)
{
printf("the number is palindrome");
}
else
{
printf("the number is not palindrome");
}
getch();
}
/* http://native-code.blogspot.com */

Post a Comment