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 run a shell in the unix system?
What is function overriding in c++?
What are the differences between new and malloc?
Write a function to find the nth item from the end of a linked list in a single pass.
What is the precedence when there is a global variable and a local variable in the program with the same name?
What is malloc in c++?
What is the purpose of ios::basefield in the following statement?
Explain the isa and hasa class relationships. How would you implement each?
Is python better than c++?
Define 'std'.
How we can differentiate between a pre and post increment operators during overloading?
What is object oriented programming (oop)?
What is the use of map in c++?
What are the effects after calling the delete this operator ?
Show the declaration for a static function pointer.