Skip to main content

WRITE A PROGRAM TO PRINT ARMSTRONG NOS. FROM 1OO TO 999


#include<stdio.h>
#include<conio.h>
void main()
{
int n,r=0,n2=0,i=153;

clrscr();

printf("ARMSTRONG NUMBERS FROM 100 TO 999 ARE = \n");

while(i<1000)
{
n=i;
n2=0;
while(n!=0)
{
r=n%10;
n2=n2+r*r*r;
n=n/10;
}
 if(n2==i)
 printf("%d\n",n2);
i=i+1;
}
getch();
}

SIMPLE PROGRAMS
FUNCTIONS


NUMBERS


STRINGS AND CHARACTERS

Comments

Popular posts from this blog

unix commands