19 lines
1019 B
C
19 lines
1019 B
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* 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);
|
|
}
|