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

If dog is a friend of boy and boy is a friend of house, is dog a friend of house?

949


Explain explicit container.

1035


What is an html tag?

1077


What is extern c++?

944


How to give an alternate name to a namespace?

1045


What is unary operator? List out the different operators involved in the unary operator.

939


Show the declaration for a static function pointer.

1006


What do you understand by a pure virtual member function?

939


why is iostream::eof inside a loop condition considered wrong?

1008


You have two pairs: new() and delete() and another pair : alloc() and free(). Explain differences between eg. New() and malloc()

1088


What is the best book for c++ beginners?

979


what are the iterator and generic algorithms.

2095


What are the steps in the development cycle?

1033


What is a lambda function c++?

1031


What is scope operator in c++?

1036