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

What does flush do?

559


What is std namespace in c++?

718


What's c++ used for?

595


List down the guideline that should be followed while using friend function.

649


Where must the declaration of a friend function appear?

537






How do you declare a set in c++?

536


What is long in c++?

735


What is :: operator in c++?

580


Write a program to add three numbers in C++ utilizing classes.

621


What does getch() do according to the ANSI C++ standard a) Reads in a character b) Checks the keyboard buffer c) Nothing in particular (Its not defined there)

600


What is the difference between C and CPP?

627


What is double in c++?

561


Is turbo c++ free?

619


What are iterators in c++?

594


What is the syntax for a for loop?

601