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 the best c++ ide?
What is the basic structure of c++ program?
Explain about Virtual Function in C++?
Explain terminate() and unexpected() function?
What is math h in c++?
Is c++ the hardest language?
What is an html tag?
List down the guideline that should be followed while using friend function.
Can c++ be faster than c?
What is a lambda function c++?
what are Operators and explain with an example?
Can member functions be private?
Which software is best for programming?
When should you use global variables?
How one would use switch in a program?