write program for palindrome
Answer Posted / apoorv
#include<stdio.h>
#include<conio.h>
int main()
{
long int n,s=0,m,r;
printf("enter any no");
scanf("%ld",&n);
m=n;
while(n>0)
{
r=n%10;
s=s*10+r;
n=n/10;
}
if(m==s)
printf("the no is palindrome");
else
printf("no is not palindrome");
getch();
}
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
Difference between Abstraction and encapsulation in C++?
What are the restrictions apply to constructors and destructors?
What does getch() do according to the ANSI C++ standard a) Reads in a character b) Checks the keyboard buffer c) Nothing in particular (Its not defined there)
What are the various arithmetic operators in c++?
What is buffer and example?
How to declaring variables in c++?
What are the new features that iso/ansi c++ has added to original c++ specifications?
What is auto used for in c++?
Explain the problem with overriding functions
When you overload member functions, in what ways must they differ?
Do vectors start at 0 c++?
Can we use struct in c++?
What does catch(…) mean?
If dog is a friend of boy, is boy a friend of dog?
find the two largest values among the 6 numbers using control structures : do-while,for,if else,nestedif- else ,while. one or two of them.