Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int
- ft_r_power (int nb, int power)
- {
- if (power == 0)
- {
- return (1);
- }
- else if (power < 0)
- {
- return (0);
- }
- nb = nb * ft_r_power(nb, power - 1);
- return (nb);
- }
- int
- main ()
- {
- int a = 16;
- int b = 5;
- ft_r_power (a, b);
- printf ("%d", ft_r_power (a, b));
- }
Advertisement
Add Comment
Please, Sign In to add comment