#include<stdio.h>
#include<conio.h>
int main()
{
int n,sum,temp,rem;
n=100;
sum=0;
printf(" Armstrong Number betWeen 100 to 1000 :-");
temp=n;
while(n<=1000)
{
temp=n;
while(temp!=0)
{
rem=temp%10;
sum+=rem*rem*rem;
temp=temp/10;
}
if(n==sum)
printf(" %d ",sum);
sum=0;
n++;
}
getch();
return 0;
}
No comments:
Post a Comment