You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var console = require("console");
var fibonacci = function (num) {
var num1 = 0;
var num2 = 1;
var sum;
var i = 0;
for (i = 0; i < num; i++) {
sum = num1 + num2;
num1 = num2;
num2 = sum;
}
return num2;
}
console.log("Fibonacci(5): " + fibonacci(5));
console.log("Fibonacci(8): " + fibonacci(8));
Recursion broken (fibo.js)?
RESULT:
RESULT:
Lowest denominator:
The text was updated successfully, but these errors were encountered: