The following code shows how to Display All Strong Numbers in the Given Range in C.

//Find All Strong Numbers in the Given Range

#include <stdio.h>
long factorial(int n)
{
    long f=1, i;
    for(i=1;i<=n;i++)
        f*=i;
    return f;
}
int main()
{
    int mynum, temp, rem, low, high;
    long digitsum=0;
    printf("Enter the lower value limit of the range: ");
    scanf("%d", &low);
    printf("Enter the higher limit of the range: ");
    scanf("%d", &high);
    printf("\nStrong Numbers in the Range [%d, %d] are....\n", low, high);
    for(mynum=low;mynum<=high;mynum++){
        temp=mynum;
        while(temp!=0)
       {
          rem=temp%10;
            digitsum+=factorial(rem);
            temp=temp/10;
        }
        if(digitsum==mynum)
        {
           printf("%d ", mynum);
        }
        digitsum=0;
    }
    return 0;
}

Output

Enter the higher limit of the range: 100000

Strong Numbers in the Range [1, 100000] are….
1 2 145 40585


Further Reading

50+ C Programming Interview Questions and Answers

C Program to Find Factorial of a Number