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 / noor alam khan

#include<iostream.h>
#include<conio.h>

main()
{
int n, reverse = 0, temp;

cout<<"Enter a number to check if it is a palindrome or
not\n"<<endl;
cin>>n;

temp = n;

while( temp != 0 )
{
reverse = reverse * 10;
reverse = reverse + temp%10;
temp = temp/10;
}

if ( n == reverse )
cout<<n<<" is a palindrome number \n"<<endl;
else
cout<<n<<"is not a palindrome number"<<endl;

return 0;
}

Is This Answer Correct ?    0 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Difference between a copy constructor and an assignment operator.

934


Does a derived class inherit or doesn't inherit?

1037


Can you be able to identify between straight- through and cross- over cable wiring? And in what case do you use straight- through and cross-over?

1047


How are pointers type-cast?

1061


Is c++ a low level language?

916


Can malloc be used in c++?

1025


Explain the term memory alignment?

1159


Explain differences between alloc() and free()?

1044


What are the three forms of cin.get() and what are their differences?

1153


Is there any difference between int [] a and int a [] in c++?

944


What is singleton class in c++?

985


What is a binary file? List the merits and demerits of the binary file usagein C++.

1232


What is the extension of c++?

926


Explain rethrowing exceptions with an example?

979


Define friend function.

983