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
write a corrected statement so that the instruction will work properly. if (4 < x < 11) y = 2 * x;
Define copy constructor.
What are iterators in c++?
List down the guideline that should be followed while using friend function.
Are strings mutable in c++?
What is an overflow error?
When must you use a pointer rather than a reference?
What is the use of endl?
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?
What is istream and ostream in c++?
What do you mean by “this” pointer?
Is it possible to provide special behavior for one instance of a template but not for other instances?
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?
What is vector pair in c++?
What is cin clear () in c++?