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/corC05ma/ex00/a.out Executable file

Binary file not shown.

View File

@ -0,0 +1,35 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_iterative_factorial.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/07/19 17:18:33 by cchauvet #+# #+# */
/* Updated: 2022/07/28 17:23:42 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
int ft_iterative_factorial(int nb)
{
int nbr_out;
if (nb < 0)
return (0);
nbr_out = 1;
while (nb > 0)
{
nbr_out = nbr_out * nb;
nb--;
}
return (nbr_out);
}
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
if (argc > 1)
printf("%d", ft_iterative_factorial(atoi(argv[1])));
}