Answer Posted / ramesh
#include<iostream.h>
#include<conio.h>
void main()
{
int sum=0,n,m;
clrscr();
cin>>n;
m=n;
while(n>0)
{
m=n%10;
sum=sum+(m*m*m);
n=n/10;
}
if(m==sum)
{
cout<<"the given number is amstrong";
}
else
{
cout<<"the given number is not amstrong";
}
getch();
}
Is This Answer Correct ? | 4 Yes | 3 No |
Post New Answer View All Answers
What is a terminating character in c++?
Give example of a pure virtual function in c++?
Why was c++ created?
Which programming language is best to learn first?
How do I write a c++ program?
Is main a class in c++?
Describe linkages and types of linkages?
What is a static element?
Is c++ still being used?
Define Virtual function in C++.
What is using namespace std in c++?
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 Write about the role of c++ in the tradeoff of safety vs. Usability? Do class declarations end with a semicolon? What are member functions used in c++?