write program for palindrome

Answer Posted / badsha

#include<iostream.h>
void main()
{
int m=0,n,s=0,r;
cout<<"Enter any number :"<<endl;
cin>>n;
m=n;
while(n>0)
{
r=n%10;
s=s*10+r;
n=n/10;
}
if(m==s)
{
cout<<"it is palindrom :"<<endl;
}
else
{
cout<<"No is Not palindrom :"<<endl;
}
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the word you will use when defining a function in base class to allow this function to be a polimorphic function?

668


How can you quickly find the number of elements stored in a a) static array b) dynamic array ? Why is it difficult to store linked list in an array?how can you find the nodes with repetetive data in a linked list?

614


What is the type of 'this' pointer? When does it get created?

542


Name the operators that cannot be overloaded in C++?

583


Would you rather wait for quicksort, linear search, or bubble sort on a 200000 element array? (Or go to lunch...) a) Quicksort b) Linear Search c) Bubble Sort

630






Can we inherit constructor in c++?

584


Write about the use of the virtual destructor?

604


What is the difference between a template and a macro?

582


What is struct c++?

563


How do you sort a sort function in c++ to sort in descending order?

552


What is difference between rand () and srand ()?

588


Can you pass an array to a function in c++?

537


Why do we use iterators?

616


Explain the difference between class and struct in c++?

590


What will the line of code below print out and why?

322