27 lines
384 B
C
27 lines
384 B
C
#include <stdio.h>
|
|
|
|
// Factorial calculation with recursive calls
|
|
long long factorial(int b) {
|
|
if (b <= 1) {
|
|
return 1;
|
|
}
|
|
return (long long)b * factorial(b - 1);
|
|
}
|
|
|
|
int min(int a, int b)
|
|
{
|
|
int result = (a >= b) ? b : a;
|
|
return result;
|
|
}
|
|
|
|
|
|
int main(void) {
|
|
int input = 5;
|
|
|
|
input = min(input, 10);
|
|
|
|
long long result = factorial(input);
|
|
|
|
return 0;
|
|
}
|