answered By bhjahnavi 0

ARMSTRONG :

Each individual number of a number is cubed and added then the sum must be equal to the given number then it is called as Armstrong.

Each individual number of a number is cubed and added then the sum must be equal to the given number then it is called as Armstrong.

```
/*program for Armstrong*/
#include<stdio.h>
#include<iostream.h>
#include<conio.h>
void main()
{
int sum=0,n,m;
clrscr();
cout<<"enter a number";
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();
}
```

flag

Write A Tutorials

Question tags

Similar questions

Follow this question

Follow c++ category

Question tags

c++
× 1

Asked
**2 years and 4 months ago ago**

Number of Views -171

Number of Answers -1

Last updated

**2 years and 2 months ago ago**

Number of Views -171

Number of Answers -1

Last updated

Similar questions