write program for palindrome
Answer Posted / easwar
#include<stdio.h>
#include<conio.h>
void main()
{
int n,s=0,m,r;
clrscr();
printf("enter any no");
scanf("%d",&n);
m=n;
while(n>0)
{
r=n%10;
s=s*10+r;
n=n/10;
}
if(s == m) // This is important step
printf("the no is palindrome");
else
printf("no is not palindrome");
getch();
}
| Is This Answer Correct ? | 172 Yes | 77 No |
Post New Answer View All Answers
Does c++ support multilevel and multiple inheritances?
Write a program using display() function which takes two arguments.
What are pointer-to-members in C++? Give their syntax.
What would happen on forgetting [], while deallocating an array through new?
How do I tokenize a string in c++?
How do you define/declare constants in c++?
Do the names of parameters have to agree in the prototype, definition, and call to the function?
What is a multiset c++?
Are php strings immutable?
what is multi-threading in C++?
Explain one-definition rule (odr).
What does iomanip mean in c++?
How does c++ structure differ from c++ class?
What is a multimap c++?
Will this c++ program execute or not?