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
If a round rectangle has straight edges and rounded corners, your roundrect class inherits both from rectangle and from circle, and they in turn both inherit from shape, how many shapes are created when you create a roundrect?
Is c++ used anymore?
Where is atoi defined?
What is the purpose of templates in c++?
What do you mean by friend class & friend function in c++?
Out of fgets() and gets() which function is safe to use?
How many types of modularization are there in c++?
What is enum class in c++?
How do I run c++?
What is meant by iomanip in c++?
How do I run a program in notepad ++?
Is c# written in c++?
Is there a c++ certification?
Evaluate the following expression as C++ would do :8 * 9 + 2 * 5 a) 82 b) 79 c) 370 d) list
If dog is a friend of boy and boy is a friend of house, is dog a friend of house?