write program for palindrome
Answer Posted / syfith
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int n,k,i,t,rev;
cout<<"enter your number = ";
cin>>n;
k=n;
while(t>0)
{
i=n%10;
rev=rev*10+i;
t=n/10;
n=n/10;
}
if(rev==k)
cout<<"it is a palindrome";
else
cout<<"it is not a palindrome";
getch();
}
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Which one is a preferred language C or C++? Why?
Discussion on error handling of C++ .
Explain public, protected, private in c++?
Are c and c++ different?
What are destructors?
Explain the pure virtual functions?
Which is the best c++ compiler for beginners?
Difference between pass by value and pass by reference?
What is c++ best used for?
what are the decision making statements in C++? Explain if statement with an example?
What type of question are asked in GE code writing test based on c++ data structures and pointers?
How is data hiding achieved in c++?
Will rust take over c++?
What is ios flag in c++?
What is the best c c++ compiler for windows?