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 you know about c++?
What can I use instead of namespace std?
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
How do I tokenize a string in c++?
Please explain the reference variable in c++?
What do you mean by public protected and private in c++?
What is :: operator in c++?
When should you use global variables?
What is general format for a prototype?
Explain the uses of static class data?
Explain explicit container.
What are the five basic elements of a c++ program?
What are virtual functions in c++?
Can we run c program in turbo c++?
Why is c++ awesome?