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 do you understand by zombie objects in c++?
Is it possible for a member function to use delete this?
How do I run a program in notepad ++?
what are the iterator and generic algorithms.
What is the best way to take screenshots of a window with c++ in windows?
Explain function overloading
What is anonymous object in c++?
What is the difference between multiple and multilevel inheritance in c++?
Program to check whether a word is a sub-string or not of a string typed
What is the exit function in c++?
Define a pdb file.
What is meant by forward referencing and when should it be used?
What is lazy initialization in c++?
Is c++ built on c?
What is the full form of dos?