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 new return if there is insufficient memory to make your new object?
What is the protected keyword used for?
What is using namespace std in cpp?
What is the use of endl in c++ give an example?
What are single and multiple inheritances in c++?
What is set in c++?
What causes a runtime error c++?
How to allocate memory dynamically for a reference?
What is an iterator?
What is class syntax c++?
Can a built-in function be recursive?
Which coding certification is best?
Explain the difference between c & c++?
What is the best c++ compiler?
What is stl containers in c++?