42_C_PISCINE/C/c05v1/ex03/ft_recursive_power.c

19 lines
1019 B
C
Raw Normal View History

2023-05-17 12:45:25 -04:00
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_recursive_power.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/07/19 17:28:20 by cchauvet #+# #+# */
/* Updated: 2022/07/25 17:30:19 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
int ft_recursive_power(int nb, int power)
{
if (power <= 0)
return (1);
return (ft_recursive_power(nb, power - 1) * nb);
}