fibonacci - if(i==1/adjusts first line so that it contains...

This preview shows page 1 out of 1 page.

// Java Document, Author: Ashton Innocent; Assignment: Fibonacci Sequence import java.util.Scanner; public class fibonacci { public static void main(String[] args) { Scanner carbon = new Scanner(System.in); int f0 = 0; int f1 = 1; int fn; int adjusted; System.out.println("How many lines of the Fibonacci Sequence do you want to print?"); int n = carbon.nextInt(); System.out.print(f0 + "\t" + f1 + "\t"); for (int i=1;i<=(n);i++){

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture