write program for palindrome
Answer Posted / uday
#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) // This is important step
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
Explain abstraction.
what are the decision making statements in C++? Explain if statement with an example?
What is the difference between cin.read() and cin.getline()?
Why is "using namespace std;" considered bad practice?
how can i access a direct (absolute, not the offset) memory
address?
here is what i tried:
wrote a program that ask's for an address from the user,
creates a FAR pointer to that adress and shows it. then the
user can increment/decrement the value in that address by
pressing p(inc+) and m(dec-).
NOW, i compiled that program and opened it twice (in 2
different windows) and gave twice the same address to it.
now look what happen - if i change the value in
one "window" of the program, it DOES NOT change in the
other! even if they point to the same address in the memory!
here is the code snippet:
//------------------------------------------------------
#include Which one is better- macro or function? Is java easier than c++? Which c++ operator cannot overload? What is the difference between an external iterator and an internal iterator? Describe an advantage of an external iterator? Is swift faster than c++? Write a program using merge () function to combine the elements of array x[ ] and y[ ] into array z[ ]. What do you mean by volatile and mutable keywords used in c++? Define copy constructor. What is the use of cmath in c++? Define a nested class.