Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

write program for palindrome

Answer Posted / purnachandra sahoo

/*Program to check whether a number is palindrom or not*/
#include<iostream.h>
#include<conio.h>
int pall(int);
void main()
{
int n,res;
clrscr();
cout<<"Enter the number :";
cin>>n;
res=pall(n);
cout<<" which is:"<<res;
getch();
}
int pall(int x)
{
int p,a,sum=0;
p=x;
while(x!=0)
{
a=x%10;
sum=sum*10+a;
x=x/10;
}
if(sum==p)
{
cout<<"\nThe enterd number is palindrom" ;
return(sum);
}
else
{
cout<<"\nThe entered number is not palindrom" ;
return 0;
}
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the c++ code?

1170


Carry out conversion of one object of user-defined type to another?

1048


What is a null object in c++?

1233


what are the decision making statements in C++? Explain if statement with an example?

1097


What is the best it certification?

1124


What is searching?

1127


Explain the difference between class and struct in c++?

1044


What is data structure in c++?

1148


Write a C++ Program to check whether a number is prime number or not?

1132


What is #include ctype h in c++?

1173


Where are setjmp and longjmp used in c++?

1122


Explain overriding.

988


What is the use of namespace std in C++?

1071


What are the various operations performed on stack?

1101


What return value must conversion operators have in their declaration?

1094