Day 31: Fibonacci Series N of N Numbers of 100DaysCodingChallenge
Hello all,
I have started the 100 days of coding challenge to improve my programming skills..
Today is the Day31 of 100DaysCodingChallenge for
Fibonacci Series N Numbers input Numbers taken by the user.
Code :
let n = prompt("Enter N : "); let f1 = 0; let f2 = 1; let f = f1 + f2; let fs = 0; console.log("Fibonacci Series upto a Certain number", n, "is : "); console.log(f1); console.log(f2); while (f <= n) { console.log(f); f1 = f2; f2 = f; f = f1 + f2; }
Output :
Happy Coding:)
Comments
Post a Comment