MnMWizard icon

Untitled

MnMWizard | PRO | 11/06/17 02:01:20 PM UTC | 0 ⭐ | 382 👁️ | Never ⏰ | []
text |

510 B

|

None

|

0 👍

/

0 👎

//Mason Marnell
 class Fibo {
      public static void main(String[] args) {
         long fibo[] = new long[30];
        fibo[0] = 1;
        fibo[1] = 1;
       // make a for loop
        // let the current fibo equal the sum of the previous 2
        for(int j = 2; j < fibo.length; j++){
        	fibo[j] = fibo[j-1] + fibo[j-2];
        }
         for (int i = 0; i < fibo.length; i++) {
            System.out.println(fibo[i]);
         }
    }
 }

Comments