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
Why do we use setw in c++?
State two differences between C and C++.
What do you mean by funtion prototype?
What are static type checking?
What can I safely assume about the initial values of variables which are not explicitly initialized?
What is pointer to member?
What is vectorial capacity?
What is static function? Explain with an example
What is & in c++ function?
How we can differentiate between a pre and post increment operators during overloading?
Describe about storage allocation and scope of global, extern, static, local and register variables?
What are references in c++? What is a local reference?
What is c++ array?
Write about an iterator class?
Do the parentheses after the type name make a difference with new?