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
When do we use copy constructors?
Write a program to add three numbers in C++ utilizing classes.
What kind of jobs can I get with c++?
Is python better than c++?
Explain deep copy?
Why namespace is used in c++?
Do the parentheses after the type name make a difference with new?
. If employee B is the boss of A and C is the boss of B and D is the boss of C and E is the boss of D. Then write a program using the Database such that if an employee name is Asked to Display it also display his bosses with his name. For eg. If C is displayed it should also display D and E with C?
Difference between pointer to constant vs. Pointer constant
What is static function? Explain with an example
Explain the differences between list x; & list x();.
What is the difference between #import and #include in c++?
Can we overload operator in c++?
What apps are written in c++?
What is the difference between strcpy() and strncpy()?