aboutsummaryrefslogtreecommitdiff
path: root/entries/komodoooo/fib.rb
diff options
context:
space:
mode:
authorKomodo2022-10-27 18:12:30 +0000
committerGitHub2022-10-27 18:12:30 +0000
commitbd23ee895a521a62cd909083ee5d3d9c6124eeb2 (patch)
tree4f2cf4fe2e5dfed4f5483394a5f333647a9cfa16 /entries/komodoooo/fib.rb
parentc2cde6bb9c1a43a69a276a20ad083d88b6fa0693 (diff)
Create fib.rb
Diffstat (limited to 'entries/komodoooo/fib.rb')
-rw-r--r--entries/komodoooo/fib.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/entries/komodoooo/fib.rb b/entries/komodoooo/fib.rb
new file mode 100644
index 0000000..ce25eeb
--- /dev/null
+++ b/entries/komodoooo/fib.rb
@@ -0,0 +1,9 @@
+def fibonacci(n)
+ a,b=0,1
+ while a<n
+ puts"#{a} "
+ a,b=b,a+b
+ end
+end
+print"Number: "
+fibonacci(gets.chomp.to_i)