Created
July 11, 2022 12:07
-
-
Save tomoliv30/e7f5f61fe81a0addbffbbe3960dd9a1f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void print_factorial(uint32_t num) | |
{ | |
printf(“%u\n”, factorial(num, 1)); | |
} | |
uint32_t factorial(uint32_t num, int res) | |
{ | |
if (num >= 1) | |
return factorial(num - 1, res * num); | |
return res; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment