Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. =begin
  2. Sucesión de fibonacci utilizando
  3. recursividad en Ruby
  4.  
  5. =end
  6.  
  7. def fibonacci_recursivo(posicion)
  8. if posicion < 2
  9. return posicion
  10. end
  11. return fibonacci_recursivo(posicion - 1) + fibonacci_recursivo(posicion - 2)
  12. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement