write program for palindrome
Answer Posted / rupamrox
#include<stdio.h>
#include<conio.h>
main()
{
int n,m,p,rev;
clrscr();
printf("enter a number: ");
scanf("%d",&n);
p=n;
rev=0;
while(n>0)
{
m=n%10;
rev=rev*10+m;
n=n/10;
}
if(rev==p)
printf("%d is palindrome",p);
else
printf("%d is not palindrome",p);
getch();
}
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
What does I ++ mean in c++?
Can I learn c++ without knowing c?
What are the uses of pointers?
What is c++ hiding?
Should the this pointer can be used in the constructor?
Why is "using namespace std;" considered bad practice?
Can manipulators fall in love?
Define token in c++.
What is ios in c++?
What does ctime() do?
By using c++ with an example describe linked list?
What are dynamic type checking?
Why c++ is the best language?
What does n mean in c++?
What is object in c++ example?