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


Please Help Members By Posting Answers For Below Questions

What is main function in c++ with example?

574


Do inline functions improve performance?

658


In which situation the program terminates before reaching the breakpoint set by the user at the beginning of the mainq method?

603


Explain shallow copy?

620


What is capacity in vector in c++?

555






What you know about structures in C++?

604


How can you prevent accessing of the private parts of my class by other programmers (violating encapsulation)?

650


In a function declaration what does extern means?

606


What is while loops?

626


what is oops and list its features in c++?

565


. 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?

2773


Write a struct time where integer m, h, s are its members?

534


What are virtual functions in c++?

699


What is a character in c++?

576


List the features of oops in c++?

585