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


Please Help Members By Posting Answers For Below Questions

What are advantages of c++?

577


Explain the differences between list x; & list x();.

613


Can member functions be private?

603


What is function overloading c++?

579


How a new element can be added or pushed in a stack?

589






Write about an iterator class?

618


What is boyce codd normal form in c++?

702


What is the use of "new" operator?

667


Who was the creator of c++?

574


Explain the difference between using macro and inline functions?

587


What is :: operator in c++?

591


Can the creation of operator** is allowed to perform the to-the-power-of operations?

589


Explain what are mutator methods in c++?

577


How one would use switch in a program?

622


What is an adaptor class in c++?

612