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
What is stl containers in c++?
What are the differences between java and c++?
What are c++ templates used for?
Why was c++ made?
Differentiate between structure and class in c++.
Explain the pure virtual functions?
What is data structure in c++?
Difference between class and structure.
Is string data type in c++?
Difference between inline functions and macros?
Do you know the problem with overriding functions?
Which is the best c++ software?
What is the difference between a pointer and a link in c ++?
What is the difference between an array and a list?
Why c++ is not a pure oop language?