write program for palindrome

Answers were Sorted based on User's Feedback



write program for palindrome..

Answer / felix

#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(m==n)
printf("the no is palindrome");
else
printf("no is not palindrome");
getch();
}

Is This Answer Correct ?    242 Yes 354 No

Post New Answer

More C++ General Interview Questions

What is const in c++?

0 Answers  


Can a Structure contain a Pointer to itself?

0 Answers  


True or false, if you keep incrementing a variable, it will become negative a) True b) False c) It depends

0 Answers  


What is the difference between "calloc" and "malloc"?

9 Answers   ADP,


What is long in c++?

0 Answers  


What is a mutex and a critical section.Whats difference between them?How do each of them work?

4 Answers   CTS,


when can we use copy constructor?

6 Answers   HP,


If a header file is included twice by mistake in the program, will it give any error?

0 Answers  


What are the main characteristics of C++ as a programming language?

1 Answers  


Is java a c++?

0 Answers  


class A { public: void f(); protected: A() {} A(const A&){} }; Examine the class declaration shown above. Why are the default and copy constructors declared as protected? 1. To ensure that A cannot be created via new by a more derived class 2. To ensure that A cannot be copied 3. To ensure that A cannot be used as a base class except when public inheritance has been used 4. To ensure that A cannot be created/copied outside the inheritance chain 5. To ensure that A cannot be instantiated as a static variable

1 Answers  


Why do we use the using declaration?

0 Answers  


Categories