write program for palindrome

Answer Posted / tarun soni

#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)
printf("the no is palindrome");
else
printf("no is not palindrome");
getch();
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the basic structure of a c++ program?

789


What is a terminating character in c++?

1003


What are dynamic type checking?

775


We use library functions in the program, in what form they are provided to the program?

819


What is searching?

853






What is buffer and example?

687


Do we have to use initialization list in spite of the assignment in constructors?

750


What relational operators if statements in c++?

871


Is it possible to get the source code back from binary file?

958


When to use “const” reference arguments in a function?

782


Explain object slicing in c++?

768


What are pointer-to-members? Explain.

790


What are the advantage of using register variables?

832


What are the various operations performed on stack?

799


What does n mean in c++?

821