i tried to pass one number by one within given range from for loop to while loop to check for armstrong. but the value passed from for loop into while loop is not accepting. so any suggestion
/*program to find armstrong within a given range */
#include<stdio.h>
#include<math.h>
int main(){
int num,num1;
int i,sum=0;
int dig=0;
printf("\n enter the range to find armstrong no\n");
scanf("%d",&num);
num1=num;
for(i=0;i<num;i++){
dig=0;
sum=0;
while(i!=0)
{
dig=i%10;
sum=sum+dig*dig*dig;
i=i/10;
}
if(sum==i)
printf("\n its armstrong :%d\n",i);
}
}