write program for palindrome

Answer Posted / dinakar

#include<stdio.h>
#include<conio.h>
void main()
{
int n,s=0,m;
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 ?    242 Yes 88 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the unique features of C++.

755


What are the advantages of c++ over c?

791


What is main function in c++ with example?

773


If we want that any wildcard characters in the command line arguments should be appropriately expanded, are we required to make any special provision? If yes, which?

1224


What is recursion?

1134






Can you please explain the difference between overloading and overriding?

790


Who discovered c++?

742


What are move semantics?

851


Does c++ have finally?

726


What are the uses of pointers?

755


What are disadvantages of pointers?

770


Is c or c++ more useful?

779


What does namespace mean in c++?

803


How do I make turbo c++ full screen?

767


What are its advantages and disadvantages of multiple inheritances (virtual inheritance)?

809