write program for palindrome
Answer Posted / gaurav joshi
#include <stdio.h>
int main()
{
int number,temp,remainder,sum=0;
printf("nnEnter no: ");
scanf("%d",&number);
temp = number; //Value of temp stores unmodified n value
while(number>0)
{
remainder=number%10;
number/=10;
sum=sum*10 + remainder; //Builds value of reversed number
}
if (sum==temp)
printf ("nThe Number Is A Palindrome ");
else
printf ("nThe Number Is Not A Palindrome ");
getch ();
return 0;
}
| Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
Explain function overloading and operator overloading.
What do you mean by inheritance in c++? Explain its types.
Why struct is used in c++?
Explain the uses oof nested class?
What is the best it certification?
What is basic if statement syntax?
Is oops and c++ same?
What are the classes in c++?
How do I start a c++ project?
Differentiate between structure and class in c++.
Explain the scope of resolution operator.
What is c++ code?
What is the latest c++ version?
What is private public protected in c++?
What does std :: flush do?