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


Please Help Members By Posting Answers For Below Questions

When do we run a shell in the unix system?

566


What is function overriding in c++?

609


What are the differences between new and malloc?

633


Write a function to find the nth item from the end of a linked list in a single pass.

573


What is the precedence when there is a global variable and a local variable in the program with the same name?

642






What is malloc in c++?

561


What is the purpose of ios::basefield in the following statement?

794


Explain the isa and hasa class relationships. How would you implement each?

617


Is python better than c++?

592


Define 'std'.

613


How we can differentiate between a pre and post increment operators during overloading?

602


What is object oriented programming (oop)?

625


What is the use of map in c++?

611


What are the effects after calling the delete this operator ?

563


Show the declaration for a static function pointer.

582