title: Fibonacci sequence using array without using recursion technique
body: <p>I'm trying to generate a code that will display the Fibonacci sequence using an array I did generate a code that has the right solution but I think it's too long since the instructor told us it's gonna be a maximum of 5 lines of code
  So here is the method :</p>
  <pre><code>public static void fibonacci_array_calc(int[] array) {
      int result;
      System.out.println(&quot;Fibonacci Series of &quot; + array.length + &quot; numbers: &quot;);
      if (array.length == 0 || array.length == 1) {
          for(int i = 0;i &lt; array.length; i++)
              System.out.print(array[i] + &quot; &quot;);
      } else {
          for (int i = 0; i &lt;= 1; i++) {
              result = array[i] = i;
              System.out.print(result + &quot; &quot;);
              if (array[i] &gt;= 1) {
                  for (int j = 2; j &lt; array.length; i++, j++) {
                      result = (array[j] = (array[i] + array[i - 1]));
                      System.out.print(result + &quot; &quot;);
                  }
              }
          }
      }
  }
  </code></pre>
  <p>the output is</p>
  <pre><code>Fibonacci Series of 10 numbers: 
  0 1 1 2 3 5 8 13 21 34
  </code></pre>
  <p>it's not allowed to use the recursion technique is there any way to <strong>shorten</strong> this code?</p>