Answer Posted / roshan patel
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int x,y,d;
cout<<"\nEnter the no : ";
cin>>x;
y=x;
int sum=0;
while(y>0)
{
d=y%10;
y/=10;
sum=sum+d*d*d;
}
if(x==sum)
cout<<"\n "<<x<<" is Armstrong ";
else
cout<<"\n"<<x<<" is not Armstrong";
getch();
}
Is This Answer Correct ? | 17 Yes | 5 No |
Post New Answer View All Answers
Difference between pass by value and pass by reference?
If dog is a friend of boy and boy is a friend of house, is dog a friend of house?
What is meant by entry controlled loop? What all C++ loops are exit controlled?
Write a program to encrypt the data in a way that inputs a four digit number and replace each digit by (the sum of that digit plus 7) modulus 10. Then sweep the first digit with the third, second digit with the fourth and print the encrypted number.
What is constructor c++?
Define vptr.
What is the use of typedef?
Can comments be longer than one line?
What causes a runtime error c++?
Explain the benefits of proper inheritance.
What is the difference between reference and pointer?
What is c++ programming language?
What does the linker do?
What are arithmetic operators?
What is public, protected, private in c++?