How to make a dynamic array java program that displays the Fibonacci numbers | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to make a dynamic array java program that displays the Fibonacci numbers

I hope you can help me with this.

10th Nov 2016, 4:58 PM
Jayden Orr
Jayden Orr - avatar
1 Answer
+ 1
public class Program { public static void main(String[] args) { int f1, f2=0, f3=1; for(int i=1;i<=10;i++){ System.out.print(" "+f3+" "); f1 = f2; f2 = f3; f3 = f1 + f2; } } } do you want to store numbers in array, tell me I will do that
10th Nov 2016, 5:21 PM
Aditya kumar pandey
Aditya kumar pandey - avatar