write program for palindrome

Answer Posted / saurav sadangi

#include<stdio.h>

int main(){
int m,n,sum=0,r;
printf("Enter n: ");
scanf("%d",&n);
m=n;
while(n>0){
r=n%10;
sum=sum*10+r;
n=n/10;
}
if(sum==m){
printf("The no %d is pallendrom\n",m);
}
else{
printf("The no %d is not pallendrom\n",m);
}
system("PAUSE");
return 0;
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

When the constructor of a base class calls a virtual function, why doesn't the override function of the derived class gets called?

803


What is private inheritance?

817


Describe public access specifiers?

779


Can comments be nested?

795


Differentiate between an array and a list?

915






What would happen on forgetting [], while deallocating an array through new?

818


What is an adaptor class in c++?

768


What is ctime c++?

823


What is the difference between *p++ and (*p)++ ?

971


What are the extraction and insertion operators in c++?

742


What is a type library?

858


What are friend functions in C++?

795


What is DlgProc?

765


What does std :: flush do?

856


What is ofstream c++?

800