Program to find the strong number

Strong Number
  void strong_number() 
  { 
    int num,i,p,r,sum=0,save_num; 
    printf("\n Enter a number:\t"); 
    scanf("%d",&num); 
    save_num=num; 
    while(num) 
    { 
        i=1,p=1; 
        r=num%10; 
    while(i<=r) 
      { 
        p=p*i; 
        i++; 
      } //while 
        sum=sum+p; 
        num=num/10; 
    } //while 
    if(sum==save_num) 
      printf("%d is a Strong number", save_num); 
    else 
      printf("%d is not a Strong number", save_num); 
  }


Output:

Enter a number:        153
153 is not a Strong number

Share this

Related Posts

Dear User,

Thank you for your comment. Hope you like this blog. Kindly share us on Social Media so others can be updated.

-Chief Administrative Officer.