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
What do you mean by a template?
why and when we can declar member fuction as a private in the class?
What is a Default constructor?
What are the new features that iso/ansi c++ has added to original c++ specifications?
what is C++ exceptional handling?
What is late binding c++?
What is the type of this pointer in c++?
What is the main use of c++?
Write a code/algo to find the frequency of each element in an array?
Tell me can a pure virtual function have an implementation?
What is the full form of ios?
What is virtual destructor ans explain its use?
Are iterators pointers?
What does getch() do according to the ANSI C++ standard a) Reads in a character b) Checks the keyboard buffer c) Nothing in particular (Its not defined there)
Show the declaration for a static member variable.