int main() { int num,i,f,r,sum=0,temp; printf("enter the number"); scanf("%d",&num); temp=num;// 2. while loops are used while(num)//1 for to take digits { i=1,f=1; r=num%10; while(i<=r)// another to take factorial { f=i*f;//f always 1 ,, only i is varying i++; } sum=sum+f;// link with 1st for loop num=num/10; // this is for 1 while loop division } if(sum==temp) printf("the number %d is a strong number",temp); else printf("the number %d is not a strong number",temp); }
Comments