write program for palindrome
Answer Posted / gaurav joshi garur (bageshwar)
#include<stdio.h> main()
{
int n, reverse = 0, temp; printf("Enter a number to check if it is a
palindrome or not\n");
scanf("%d",&n); temp = n; while( temp != 0 )
{
reverse = reverse * 10;
reverse = reverse + temp%10;
temp = temp/10;
} if ( n == reverse )
printf("%d is a palindrome number.\n", n);
else
printf("%d is not a palindrome number.\n",
n); return 0;
}
| Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
What is the best c++ book for beginners?
Define the operators that can be used with a pointer.
What is & in c++ function?
Why c++ is better than c language?
Is it possible to get the source code back from binary file?
Differentiate between a copy constructor and an overloaded assignment operator.
What is flush programming?
Is string an object in c++?
How can you create a virtual copy constructor?
What is the use of object in c++?
What is pure virtual function? Or what is abstract class?
When must you use a pointer rather than a reference?
Why is polymorphism useful?
What is c++ and its uses?
Is multimap sorted c++?