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

Can circle be called an ellipse?

818


What are manipulators used for?

808


How java is different from c and c++?

899


How are virtual functions implemented in c++?

787


What is a try block?

824






Why is c++ not purely object oriented?

747


the maximum length of a character constant can be a) 2 b) 1 c) 8

854


Mention the purpose of istream class?

802


What is flag in computer?

790


Difference between declaration and definition of a variable.

848


What are keywords in c++?

812


What is cout flush?

746


What is size of string in c++?

717


What do you mean by early binding?

766


What is the last index number in an array of 100 characters a) 100 b) 99 c) 101

816