ARMSTRONG NUMBERS USING C
/*ARMSTRONG NUMBERS*/
#include<stdio.h>
#include<conio.h>
void main()
{
int i,sum,n,d;
clrscr();
printf("armstrong number series from 100 and 1000");
for(i=100;i<1000;i++)
{
n=i;
sum=0;
while(n!=0)
{
d=n%10;
n=n/10;
sum=sum+d*d*d;
}
if(sum==i)
printf("\n%d",i);
}
getch();
}
OUTPUT:
Armstrong number series from 100 and 1000
153
370
371
407
Hi..
ReplyDeletevivekananthan..
i like this programs.