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
Can circle be called an ellipse?
What are manipulators used for?
How java is different from c and c++?
How are virtual functions implemented in c++?
What is a try block?
Why is c++ not purely object oriented?
the maximum length of a character constant can be a) 2 b) 1 c) 8
Mention the purpose of istream class?
What is flag in computer?
Difference between declaration and definition of a variable.
What are keywords in c++?
What is cout flush?
What is size of string in c++?
What do you mean by early binding?
What is the last index number in an array of 100 characters a) 100 b) 99 c) 101