write program for palindrome
Answer Posted / amol
#include<stdio.h>
void main()
{
int p,q,r,s=0;
printf("\n Enter the number ::");
scanf("%d",&p);
q=p;
while(p>0)
{
r=p%10;
s=s*10+r;
p=p/10;
}
if(s==q)
{
printf("\n Entered number is palindrome...!!!");
}
else
{
printf("\n Enterde number is NOT a palindrome...!!!");
}
getch();
}
| Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
What is a null object in c++?
What is c++ manipulator?
Which programming language's unsatisfactory performance led to the discovery of c++?
What does extern mean in a function declaration in c++?
What is the limitation of cin while taking input for character array?
Reverse the Linked List. Input: 1->2->3->4->5->NULL Output: 5->4->3->2->1->NULL
what is a class? Explain with an example.
Is dev c++ a good compiler?
What sorting algorithm does c++ use?
Explain rtti.
What is the difference between the functions rand(), random(), srand() and randomize()?
How do I use turbo c++?
Explain the difference between using macro and inline functions?
Describe the advantage of an external iterator.
What is the use of object in c++?