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 main function in c++ with example?
Do inline functions improve performance?
In which situation the program terminates before reaching the breakpoint set by the user at the beginning of the mainq method?
Explain shallow copy?
What is capacity in vector in c++?
What you know about structures in C++?
How can you prevent accessing of the private parts of my class by other programmers (violating encapsulation)?
In a function declaration what does extern means?
What is while loops?
what is oops and list its features in c++?
. If employee B is the boss of A and C is the boss of B and D is the boss of C and E is the boss of D. Then write a program using the Database such that if an employee name is Asked to Display it also display his bosses with his name. For eg. If C is displayed it should also display D and E with C?
Write a struct time where integer m, h, s are its members?
What are virtual functions in c++?
What is a character in c++?
List the features of oops in c++?