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
Explain deep copy and a shallow copy?
What are literals in C++?
write a programme to get a character and thier ASCII value
Is oops and c++ same?
Can comments be longer than one line?
Is c++ the most powerful language?
What do manipulators do?
Is java the same as c++?
When should you use global variables?
Explain the use of this pointer?
Differentiate between the manipulator and setf( ) function?
Explain the concept of copy constructor?
What is meant by the term name mangling in c++?
Why do we use constructor?
Can static member variables be private?