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 are virtual functions in c++?
What is ios class in c++?
What does catch(…) mean?
What are the four main data types?
What is private public protected in c++?
Differentiate between an external iterator and an internal iterator? What is the advantage of an external iterator.
Which programming language is best?
What is static function? Explain with an example
what do you mean by volatile variable?
What is the outcome of cout< a) 16 b) 17 c) 16.5
What is the difference between C and CPP?
What doescout<<(0==0) print out a) 0 b) 1 c) Compiler error: Lvalue required
What does flush do c++?
What are structs in c++?
Is eclipse good for c++?