how to write palindrome program?

Answer Posted / a.prathyusha

#include<stdio.h>
void main()
{
int n,s=0,r,n1;
printf("enter any number:");
scanf("%d",&n);
n1=n;
while(n>0)
{
r=n%10;
s=(s*10)+r;
n=n/10;
}
if(s==n1)
printf("palindrom");
else
printf("not palindrom");
}

Is This Answer Correct ?    7 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Are pointers integer?

554


Explain what is meant by 'bit masking'?

646


Is linux written in c?

603


Why enum is used in c?

528


Is c weakly typed?

581






How can I get back to the interactive keyboard if stdin is redirected?

673


Do you know the purpose of 'register' keyword?

644


Compare interpreters and compilers.

642


Is javascript written in c?

586


What is difference between static and global variable in c?

541


What is C language ?

1533


How are Structure passing and returning implemented by the complier?

717


What is the difference between Printf(..) and sprint(...) ?

792


a parameter passed between a calling program and a called program a) variable b) constant c) argument d) all of the above

659


How is a null pointer different from a dangling pointer?

559