Line | Branch | Exec | Source |
---|---|---|---|
1 | /* | ||
2 | ** EPITECH PROJECT, 2023 | ||
3 | ** day05 | ||
4 | ** File description: | ||
5 | ** Task02 | ||
6 | */ | ||
7 | |||
8 | 4 | int my_compute_factorial_rec(int nb) | |
9 | { | ||
10 |
3/4✓ Branch 0 taken 4 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
✓ Branch 3 taken 3 times.
|
4 | if (nb == 0 || nb == 1) { |
11 | 1 | return 1; | |
12 |
3/4✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 1 times.
|
3 | } else if (nb > 1 && nb < 13) { |
13 | 2 | return nb * my_compute_factorial_rec(nb - 1); | |
14 | } else { | ||
15 | 1 | return 0; | |
16 | } | ||
17 | } | ||
18 |