title: Java Fibonacci sequence
body: <p>Write a program to calculate the first 10 Fibonacci numbers and store the results in a one-dimensional array. In a second array calculate and store the average values of the adjacent numbers in the series. The first array should contain integer values and the second floating point values. Output the contents of both arrays in a neat format</p>
  
  <pre><code> public static void main(String[] args) {
       //number of elements to generate in a series
       int limit = 10;
  
       long[] series = new long[limit];
  
       //create first 2 series elements
       series[0] = 1;
       series[1] = 1;
  
       //create the Fibonacci series and store it in an array
       for(int i=2; i &lt; limit; i++){
           series[i] = series[i-1] + series[i-2];
       }
  
       //print the Fibonacci series numbers
       System.out.println("Fibonacci Series upto " + limit);
       for (int i = 0; i &lt; limit; i++) {
           System.out.print(series[i] + " ");
       }
  }
  </code></pre>
  
  <p>Okay so the first part is working fine but now to create an array to calculate the average is a bit tricky for me.So far I tried this.</p>
  
  <pre><code>int[] numbers = new int[]{1,1,2,3,5,8,13,21,34,55};
  int sum=0;
  for (int i = 0; i &lt; numbers.length ; i++) {        
       sum = (int) (sum + numbers[i]);
       double average = (double)sum/numbers.length;
       System.out.println("Average value of array elements is : " + average);
  }
  </code></pre>
  
  <p>But its not working quite well.Can someone offer me some light on this ? </p>