## Armstrong numbers:

Input :say 370.

Calculating armstrong number:

370=(3*3*3)+(7*7*7)+(0*0*0)= 27+343+0 =370

If input equals output, 370==370, 370 is armstrong number.

```
#include<stdio.h>
#include<conio.h>
void main()
{
int num, n, rem;
int cube=0, sum;
printf("n Armstrong numbers between 0 and 999 are: n");
for(num=0;num<=999;num++)
{
sum=0;
n=num;
do
{
rem=n%10;
cube=rem*rem*rem;
sum=sum+cube;
n=n/10;
}while(n>0);
if(num==sum)
{
printf("n%d is armstrong number",num);
}
getch();
}
```

**Ouput:**

```
Armstrong numbers between 0 and 999 are:
0 is armstrong number
1 is armstrong number
153 is armstrong number
370 is armstrong number
371 is armstrong number
407 is armstrong number
```