Friday 31 August 2012

Palindrome number program in cpp(c++) with source code

How to write c++ palindrom number Program with source code

121=121 is palindrom.
167=761 is not a palindrome number.
int pali(int);
void main()
{
int n,a;
clrscr();
cout<<"\n enter the number=";
cin>>n;
a=palindrom(n);
if(n==a)
cout<<"\n number is palindrom";
else
cout<<"\n number is not palindrom";
getch();
}
int palindrom(int x)
{
int r,sum=0;
while(x!=0)
{
r=x%10;

sum=sum*10+r;
x/=10;
}
return(sum);
}
Share This
Previous Post
Next Post

FYJC XI standard online admisson Process and declaraton of Merit list . Cut off List For prevous year also . 10 Th Results onlne declaraton Maharashtra Region .

0 comments: