#include <stdio.h>
#include <conio.h>
void main()
{
int n=1,dum,sum=0,r;
clrscr();
printf("Armstrong nos between 1 to 500/n");
while (n<=500)
{
dum=n;
while (dum>0)
{
r=dum%10;
sum=sum+(r*r*r);
dum=dum/10;
}
if(sum==n)
printf("\n\n%d",sum);
n=n+1;
sum=0;
}
getch();
Subscribe to:
Post Comments (Atom)
Related Post
Array:
String functions:
General (Loops-for/while)
This comment has been removed by the author.
ReplyDeleteArmstrong program in C
ReplyDeletepost is helpful
i really like that C tutorials for beginners
ReplyDelete