Day 93: Fibonacci Series Using Recursion of 100DaysCodingChallenge
Hello all,
#day93
Day93
Today's my task was to Write a Program to Display Fibonacci Series only last Output Number a Certain Number n (n is entered by user) using Recursion.
I have started the 100 days of coding challenge to improve my programming skills..
Code :
const fibonacci = (n) => (n <= 2 ? 1 : fibonacci(n - 1) + fibonacci(n - 2)); //console.log(fibonacci(10)); // 55 let a = parseInt(prompt("Enter a Number : ")); console.log(fibonacci(a));
Output :
Happy Coding:)
Thank you...
Comments
Post a Comment