write program for palindrome
Answer Posted / lakshmi narayana
#include<stdio.h>
main()
{
int n,s=0,m;
printf("enter any no");
scanf("%d",&n);
m=n;
while(n>0)
{
int r=n%10;
s=s*10+r;
n=n/10;
}
if(s == m) // This is important step
printf("the no is palindrome\n");
else
printf("no is not palindrome\n");
return 0;
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Explain method of creating object in C++ ?
What is the function to call to turn an ascii string into a long?
Is c++ fully object oriented?
Which software is used for c++ programming?
How a new operator differs from the operator new?
Why was c++ created?
why is iostream::eof inside a loop condition considered wrong?
What is the purpose of template?
What is #include ctype h in c++?
What is encapsulation in c++ with example?
Write a Program to find the largest of 4 no using macros.
What do nonglobal variables default to a) auto b) register c) static
What are the two main components of c++?
What is the use of endl in c++ give an example?
Can we use clrscr in c++?