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 is the difference between set and map in c++?
What do you mean by persistent and non persistent objects?
What is tellg () in c++?
What are the stages in the development cycle?
What does n mean in c++?
How can virtual functions in c++ be implemented?
What is the benefit of learning c++?
What is pointer -to-members in C++? Give their syntax?
Carry out conversion of one object of user-defined type to another?
Differentiate between a copy constructor and an overloaded assignment operator.
Can we overload operator in c++?
What is a pointer with example?
Can there be at least some solution to determine the number of arguments passed to a variable argument list function?
What is abstract keyword in c++?
What is the basic structure of c++ program?