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
Explain the properties and principles of oop.
Differentiate between an external iterator and an internal iterator? What is the advantage of an external iterator.
List the features of oops in c++?
What does std :: flush do?
Can I have a reference as a data member of a class? If yes, then how do I initialise it?
What is copy constructor? Can we make copy constructor private in c++?
Why c++ is so important?
What are the classes in c++?
Why would you use pointers in c++?
Is nan a c++?
Is rust better than c++?
When can I use a forward declaration?
What is this pointer in c++?
What do you mean by overhead in c++?
What is the difference between ++ count and count ++?