C Programming
Computer Programming

Program in c to Display Armstrong Number Between Two Intervals



Write a Program in c to Display Armstrong Number Between Two Intervals

\* C Program to to Display Armstrong Number Between Two Intervals *\

# include < stdio.h >
int   main( )
{

int   beg, end, dig, sum, temp, cube, i, num  ;
printf(" Enter Begning of Interval : ") ;
scanf("%d ", & beg) ;
printf("\n Enter End of Interval : ") ;
scanf("%d ", & end) ;
for (   i = big;   i <= end ;   i++  ) ;
{

sum = 0 ;
num = i ;
do
{

dig = num % 10 ;
num = num / 10 ;
cube = dig * dig * dig ;
sum = sum + cube ;

}
while (   num   >   0 );
if( sum == i )
printf("\n %d " ,i) ;

}
return ( 0 ) ;

}

Output of Program :

Output of Program in C to Display Armstrong Number Between Two Intervals