Fibonacci implemented in bc

This commit is contained in:
overflowerror 2021-11-16 00:00:05 +01:00 committed by GitHub
parent 6303f4ed47
commit 01be7b0ddc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

11
bc/fib.bc Normal file
View file

@ -0,0 +1,11 @@
#!/usr/bin/bc
v1 = 1
v2 = 1
print 1, "\n", 1, "\n"
for(i = 0; i < 10; i++) {
v3 = v1 + v2
v1 = v2
v2 = v3
print v3, "\n"
}
quit