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
What does flush do?
What is std namespace in c++?
What's c++ used for?
List down the guideline that should be followed while using friend function.
Where must the declaration of a friend function appear?
How do you declare a set in c++?
What is long in c++?
What is :: operator in c++?
Write a program to add three numbers in C++ utilizing classes.
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)
What is the difference between C and CPP?
What is double in c++?
Is turbo c++ free?
What are iterators in c++?
What is the syntax for a for loop?