0
FIBONACCI NUMBERS
Please can someone help me with the answer to this exercise The Fibonacci sequence is one of the most famous formulas in mathematics. Each number in the sequence is the sum of the previous two numbers. For example, this is what the Fibonacci sequence looks like for 10 numbers, starting with 0: 0,1,1,2,3,5,8,13,21,34. Write a program that uses the Nth (variable num in the code template) positive number as input, recursively calculates and outputs the first Nth numbers of the Fibonacci sequence (starting from 0). Sample input 6 Result example 0 1 1 2 3 8 If you are composing a Fibonacci sequence for n numbers, then you need to use the condition n <= 1 as a base case.
2 odpowiedzi
+ 2
Yes, if you try yourself first and share your attempt here... 👍
0
Jayakrishna🇮🇳 so you think I didn't try to solve it before posting it here??? If you don't have an answer just skip rather than coming to say sh*t like this