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

write a corrected statement so that the instruction will work properly. if (4 < x < 11) y = 2 * x;

1520


Define copy constructor.

626


What are iterators in c++?

602


List down the guideline that should be followed while using friend function.

651


Are strings mutable in c++?

699






What is an overflow error?

627


When must you use a pointer rather than a reference?

608


What is the use of endl?

550


If a base class is an adt, and it has three pure virtual functions, how many of these functions must be overridden in its derived classes?

598


What is istream and ostream in c++?

601


What do you mean by “this” pointer?

621


Is it possible to provide special behavior for one instance of a template but not for other instances?

637


If we want that any wildcard characters in the command line arguments should be appropriately expanded, are we required to make any special provision? If yes, which?

1013


What is vector pair in c++?

719


What is cin clear () in c++?

617