write program for palindrome

Answer Posted / amol

#include<stdio.h>
void main()
{
int p,q,r,s=0;
printf("\n Enter the number ::");
scanf("%d",&p);
q=p;
while(p>0)
{
r=p%10;
s=s*10+r;
p=p/10;
}
if(s==q)
{
printf("\n Entered number is palindrome...!!!");
}
else
{
printf("\n Enterde number is NOT a palindrome...!!!");
}
getch();
}

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

which operator is used for performing an exponential operation a) > b) ^ c) none

602


Is java a c++?

558


How is objective c different from c++?

789


What it is and how it might be called (2 methods).

656


How do you sort a sort function in c++ to sort in descending order?

552






What is the use of c++ programming language in real life?

562


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

551


Why are pointers used?

578


What is static function? Explain with an example

557


Where can I run c++ program?

597


What is a down cast?

609


How can you create a virtual copy constructor?

579


What is ostream in c++?

567


What is DlgProc?

596


Explain explicit container.

632