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
How java is different from c and c++?
When you overload member functions, in what ways must they differ?
How can we access protected and private members of a class?
What are c++ storage classes?
What is the latest c++ version?
When there is a global variable and local variable with the same name, how will you access the global variable?
What are the benefits of pointers?
What is atoi?
Write a code/algo to find the frequency of each element in an array?
Does std endl flush?
What is istream and ostream in c++?
What is a linked list in c++?
Define pointers?
How do we implement inheritance in c++?
Write a program which uses Command Line Arguments