write program for palindrome
Answer Posted / aravindhan.d
// r=reminder,s=sum,n=number.
#include<stdio.h>
#include<conio.h>
void main()
{
int n,m,r,s=0;
clrscr();
printf("Enter the n value:");
scanf("%d",&n);
m=n;
while(n>0)
{
r=n%10;
s=s*10+r;
n=n/10;
}
if(m==s)//THIS SAME CODE IS GIVEN ABOVE BUT ONE CHANGE NOT m==n THAT IS m==s
{
printf("NUMBER IS PALINDROME");
}
else
{
printf("NUMBER IS NOT PALINDROME");
}
| Is This Answer Correct ? | 19 Yes | 9 No |
Post New Answer View All Answers
What is extern c++?
Does c++ vector allocate memory?
What are the advantages of using const reference arguments in a function?
Why Pointers are not used in C++?
What is isdigit c++?
Explain the difference between c++ and java.
How the keyword struct is different from the keyword class in c++?
Why is swift so fast?
How does c++ structure differ from c++ class?
What is the use of ::(scope resolution operator)?
What is meant by forward referencing and when should it be used?
What is time h in c++?
What function initalizes variables in a class: a) Destructor b) Constitutor c) Constructor
Are there any special rules about inlining?
Why is c++ considered difficult?