Guest User

Untitled

a guest
Jun 22nd, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. int fibo(int num)
  2. {
  3. if (num == 0) // <- condición de salida
  4. {
  5. return 0;
  6. }
  7. else if (num == 1) // <- otra condición de salida
  8. {
  9. return 1;
  10. }
  11. else
  12. {
  13. return(fibo(num - 1) + fibo(num - 2)); // <- llamada recursiva
  14. }
  15. }
Add Comment
Please, Sign In to add comment