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
Is c better than c++?
How do you differentiate between overloading the prefix and postfix increments?
Explain selection sorting. Also write an example.
What will the line of code below print out and why?
What is private public protected in c++?
What is std namespace in c++?
List the advantages of inheritance.
Explain virtual class and friend class.
What do you mean by ‘void’ return type?
What is oops in c++?
What do you mean by stack unwinding in c++?
Can char be a number c++?
How does work in c++?
What is the role of static keyword for a class member variable?
What are multiple inheritances (virtual inheritance)? What are its advantages and disadvantages?