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
How can you create a virtual copy constructor?
Does c++ have foreach?
What are libraries in c++?
Explain how we implement exception handling in c++?
Do vectors start at 0 c++?
what Is DCS ? what i will get benefit when i did?
What are guid?
How is data hiding achieved in c++?
What kind of jobs can I get with c++?
What are pointer-to-members? Explain.
What is the return value of the insertion operator?
What is the correct syntax for inheritance a) class aclass : public superclass b) class aclass inherit superclass c) class aclass <-superclass
How do you sort a sort function in c++ to sort in descending order?
Does a derived class inherit or doesn't inherit?
What is the best c++ compiler?