write program for palindrome
Answer Posted / easwar
#include<stdio.h>
#include<conio.h>
void main()
{
int n,s=0,m,r;
clrscr();
printf("enter any no");
scanf("%d",&n);
m=n;
while(n>0)
{
r=n%10;
s=s*10+r;
n=n/10;
}
if(s == m) // This is important step
printf("the no is palindrome");
else
printf("no is not palindrome");
getch();
}
Is This Answer Correct ? | 172 Yes | 77 No |
Post New Answer View All Answers
What is an associative container in c++?
Explain about Garbage Collector?
What is the main purpose of overloading operators?
How does a copy constructor differs from an overloaded assignment operator?
Why cstdlib is used in c++?
How can you quickly find the number of elements stored in a dynamic array? Why is it difficult to store linked list in an array?
Explain Text Manipulation Routines?
What do you mean by translation unit?
What is singleton pattern in c++?
Why do we need function?
What is const pointer and const reference?
Can I create my own functions in c++?
Comment on c++ standard exceptions?
What are 2 ways of exporting a function from a dll?
What is singleton class in c++?