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 are the events occur in intr activated on interrupt vector table
Can we use this pointer inside static member function?
What is the syntax for a for loop?
What relational operators if statements in c++?
What is the auto keyword good for in c++?
What is the difference between a definition and a declaration?
What is iterator c++?
What is c++ manipulator?
You run a shell on unix system. How would you tell which shell are you running?
What is the best way to declare and define global variables?
What is lvalue?
Do you know the problem with overriding functions?
Is c++ the most powerful language?
Define a nested class.
What c++ library is string in?