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 advantages of early binding?

608


Write a program to find the Fibonacci series recursively.

608


Write a program which uses functions like strcmp(), strcpy()? etc

620


What is protected inheritance?

598


Why is c++ called oops?

554






By using c++ with an example describe linked list?

605


Discuss the possibilities related to the termination of a program before entering the mainq method?

541


What does return 0 do in c++?

578


What does ios :: app do in c++?

551


What is the use of object in c++?

570


What are the comments in c++?

574


What flag means?

524


Refer to a name of class or function that is defined within a namespace?

608


What is the difference between global variables and static varables?

569


Why null pointer is used?

581