write program for palindrome
Answer Posted / tarun soni
#include<stdio.h>
#include<conio.h>
void main()
{
int n,s=0,m;
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)
printf("the no is palindrome");
else
printf("no is not palindrome");
getch();
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is type of 'this' pointer? Explain when it is get created?
What is the two main roles of operating system?
If horse and bird inherit virtual public from animal, do their constructors initialize the animal constructor? If pegasus inherits from both horse and bird, how does it initialize animal’s constructor?
Can union be self referenced?
Is c++ the hardest programming language?
I want to write a C++ language program that: 1. Reads in the size of a square from the screen; 2. Prints a hollow square of that size out of “-“, “|” and blanks on screen; 3. Prints the same hollow square onto a text file. The program should work for squares of all side sizes between 1 and 20.
What can I safely assume about the initial values of variables which are not explicitly initialized?
What is c++ prototype?
What are structures and unions?
If there are two catch statements, one for base and one for derived, which should come first?
If all is successful, what should main return a) 0 b) 1 c) void
What is meant by iomanip in c++?
What is the difference between a declaration and a definition?
Which one is better- macro or function?
How can you prevent accessing of the private parts of my class by other programmers (violating encapsulation)?