Advertisement
Vasilena

PracticeDayThreeExercise4

Jul 8th, 2021
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.20 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int fact(int n)
  5. {
  6.     if(n == 0){
  7.         return 1;
  8.     }
  9.     return fact(n - 1) * n;
  10. }
  11.  
  12. int main()
  13. {
  14.     printf("%d\n", fact(9));
  15.     return 0;
  16. }
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement