write program for palindrome
Answer Posted / krishna reddy
#include<stdio.h>
#include<conio.h>
void main()
{
int n,m,s,reverse=0;
clrscr();
printf("enter any no");
scanf("%d",&n);
m=n;
while(n!=0)
{
s=n%10;
reverse=reverse*10+s;
n=n/10;
}
if(m==reverse)
printf("the no is palindrome");
else
printf("no is not palindrome");
getch();
}
| Is This Answer Correct ? | 0 Yes | 2 No |
Post New Answer View All Answers
How does a copy constructor differs from an overloaded assignment operator?
What is #include c++?
What is meant by forward referencing and when should it be used?
What is private inheritance?
Define a nested class.
Write a program that takes a 5 digit number and calculates 2 power that number and prints it.
What is null and void pointer?
What is abstraction with real time example?
What do you mean by vtable and vptr in c++?
A prime number is a number which is divisible only by itself and 1. Examples of the first few primes are 2, 3, 5, 7, 11. Consider writing a program which can generate prime numbers for you. Your program should read in and set a maximum prime to generate and a minimum number to start with when looking for primes. This program should be able to perform the following tasks: 1. Read the maximum number from user (keyboard input) to look for primes. The program should not return any primes greater than this number. 2. Read the minimum number from user (keyboard input) to look for primes. The program should not return any primes less than this number. 3. Generate and print out every prime number between the maximum prime and minimum number specified by the user.
What is static function? Explain with an example
What is pointer to member?
Explain the difference between c++ and java.
Out of fgets() and gets() which function is safe to use?
What is difference between class and structure in c++?