write program for palindrome

Answer Posted / easwar

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is an associative container in c++?

739


Explain about Garbage Collector?

852


What is the main purpose of overloading operators?

781


How does a copy constructor differs from an overloaded assignment operator?

760


Why cstdlib is used in c++?

767






How can you quickly find the number of elements stored in a dynamic array? Why is it difficult to store linked list in an array?

757


Explain Text Manipulation Routines?

810


What do you mean by translation unit?

801


What is singleton pattern in c++?

703


Why do we need function?

769


What is const pointer and const reference?

791


Can I create my own functions in c++?

787


Comment on c++ standard exceptions?

839


What are 2 ways of exporting a function from a dll?

842


What is singleton class in c++?

776