Created
December 17, 2021 10:52
-
-
Save anonymoustafa/73117e3d8b8bae52d639ca70002a4b1b to your computer and use it in GitHub Desktop.
A more complete Fibonacci series calculator. Written in NodeJS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const readline = require("readline"); | |
const rl = readline.createInterface({ | |
input: process.stdin, | |
output: process.stdout, | |
}); | |
// ask user for the name input | |
rl.question(`What Fibbonacci sentence do you want to calculate? `, (last_fibbo_sentence) => { | |
fibbo(last_fibbo_sentence) | |
rl.close(); | |
}); | |
function fibbo(L) { | |
for (let i = 0, j = 1, temp, Latest_Statement = 1; Latest_Statement <= L; temp = i, i = j, j = i + temp,Latest_Statement++) { | |
console.log(j); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment