|
|
@ -3,12 +3,14 @@ |
|
|
|
#include <stdio.h> |
|
|
|
|
|
|
|
int main() { |
|
|
|
// minInput is set to 0 so there won't be any negative numbers |
|
|
|
int minInput = 0; |
|
|
|
|
|
|
|
printf("Enter a number to calculate its factorial: \n"); |
|
|
|
int number = usergetd("Enter an even number: "), minInput, NULL); |
|
|
|
|
|
|
|
int result = fakultaet(number); |
|
|
|
// result now has the factorial of the user input |
|
|
|
|
|
|
|
printf("The factorial of %d is: %d\n", number, result); |
|
|
|
|
|
|
|