write program for palindrome

Answer Posted / rupamrox

#include<stdio.h>
#include<conio.h>
main()
{
int n,m,p,rev;
clrscr();
printf("enter a number: ");
scanf("%d",&n);
p=n;
rev=0;
while(n>0)
{
m=n%10;
rev=rev*10+m;
n=n/10;
}
if(rev==p)
printf("%d is palindrome",p);
else
printf("%d is not palindrome",p);
getch();
}

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does new return if there is insufficient memory to make your new object?

580


What is the protected keyword used for?

614


What is using namespace std in cpp?

543


What is the use of endl in c++ give an example?

610


What are single and multiple inheritances in c++?

572






What is set in c++?

656


What causes a runtime error c++?

579


How to allocate memory dynamically for a reference?

542


What is an iterator?

684


What is class syntax c++?

590


Can a built-in function be recursive?

580


Which coding certification is best?

568


Explain the difference between c & c++?

579


What is the best c++ compiler?

590


What is stl containers in c++?

583