Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int fibo(int num)
- {
- if (num == 0) // <- condición de salida
- {
- return 0;
- }
- else if (num == 1) // <- otra condición de salida
- {
- return 1;
- }
- else
- {
- return(fibo(num - 1) + fibo(num - 2)); // <- llamada recursiva
- }
- }
Add Comment
Please, Sign In to add comment