Question: Write a Java program to print out the first fifteen numbers of the Fibonacci sequence using a loop. You will need three variables previous, current,
Write a Java program to print out the first fifteen numbers of the Fibonacci sequence using a loop. You will need three variables previous, current, and next (all of type long) to generate the sequence.
Start your program as follows:
package edu.cscc;
// TODO add comments with your name and the purpose of the program
public class Main { public static void main(String[] args)
{ // TODO your code goes here } }
Submit your Main.java file with your solution (via Blackboard) to you instructor for grading.
Example Output 0
1
1
2
3
5
8
13
21
34
55
89
144
233
377
Process finished with exit code 0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
