+ 1
Guys Can you please help me to solve the problem
Question is Write a program in Java to print the Fibonacci Series starting from zero. E.g.-Fibonacci Series 0,1,1,2,3,5,8.
10 Answers
0
Please specify what the problem is. Oh, and please provide your code, beforehand.
0
I am unable to write the code
Please help me out guys.
0
You could start from an array of [0, 1] and iteratively append new elements with value being the sum of two preceding elements. Then you will populate the array with consecutive numbers of the Fibonacci sequence.
0
In the program usage of array is prohibited
0
Then please help me out without using any array.Just normal code.
0
I guess you could then start with a and b equal to 0 and 1, respectively.
Then in each iteration you increase a with a+b and then b also with a+b. Then a and b will assume consecutive Fibonacci sequence elements.
0
But how will I print 0 at the beginning
0
You can start the loop with the printing statement and then start incrementing
0
Do it through with the recursion