C Programming Code Examples C > Functions Code Examples print all strong numbers between given interval using function print all strong numbers between given interval using function Write a C program to print all strong numbers between a given interval in C programming. How to print strong numbers in a given range using functions in C programming. First give a meaningful name to our function, say printStrongNumbers(). Along with this we must define function to find factorial of a number, say long long fact(int x);. Next we need to print strong numbers in range. Therefore, the function must accept two integer parameters start and end limit of strong numbers. Finally the function simply prints strong numbers in range and returns nothing. After looking on above points function declaration to print strong numbers in range is - void printStrongNumbers(int start, int end);. #include <stdio.h> /* Function declaration */ long long fact(int x); void printStrongNumbers(int start, int end); int main() { int start, end; /* Input start and end range */ printf("Enter the lower limit to find strong number: "); scanf("%d", &start); printf("Enter the upper limit to find strong number: "); scanf("%d", &end); printf("All strong numbers between %d to %d are: \n", start, end); printStrongNumbers(start, end); return 0; } /* Print all strong numbers in a given range */ void printStrongNumbers(int start, int end) { long long sum; int x; // Iterates from start to end while(start != end) { sum = 0; x = start; // Calculate sum of factorial of digits while(x != 0) { sum += fact(x % 10); x /= 10; } // If sum of factorial of digits equal to current number if(start == sum) { printf("%d, ", start); } start++; } } /* Recursively find factorial of any number */ long long fact(int x) { if(x == 0) return 1; else return (x * fact(x-1)); }