This commit is contained in:
Camille Chauvet
2023-05-17 16:45:25 +00:00
commit 29ed24d567
619 changed files with 16119 additions and 0 deletions

BIN
Correction/sam/ex01/a.out Executable file

Binary file not shown.

View File

@ -0,0 +1,30 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_recursive_factorial.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/07/19 17:06:51 by cchauvet #+# #+# */
/* Updated: 2022/08/01 14:55:59 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
int ft_recursive_factorial(int nb)
{
if (nb < 0)
return (0);
if (nb == 1)
return (nb);
else
return (nb * ft_recursive_factorial(nb - 1));
}
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
if (argc > 1)
printf("%d", ft_recursive_factorial(atoi(argv[1])));
}