0
0
This commit is contained in:
Guy Baconniere
2021-08-17 18:28:27 +02:00
parent c5b02f1036
commit 6e576f39ca
16 changed files with 329 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_recursive_power.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni <gbaconni@student.42lausan> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/17 16:50:55 by gbaconni #+# #+# */
/* Updated: 2021/08/17 17:05:03 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
int ft_recursive_power(int nb, int power)
{
if (power < 0)
nb = 0;
else if (power == 0)
nb = 1;
else
nb *= ft_recursive_power(nb, --power);
return (nb);
}