Write a method fibo that takes an array of type int as its lone input. The result of the call to fibo is that the array will be populated with the Fibonacci numbers. Elements 0 and 1 will contain 1s; subsequent elements will contain the sum of the previous two elements.
Example:
int[] nums = new int[37]; // Your method must work for ANY size array fibo(nums); System.out.println(nums[0]); // prints 1 System.out.println(nums[1]); // prints 1 System.out.println(nums[2]); // prints 2 System.out.println(nums[3]); // prints 3 System.out.println(nums[4]); // prints 5 System.out.println(nums[5]); // prints 8 System.out.println(nums[6]); // prints 13
Here is the signature of fibo to get you started. Feel free to copy and paste it into a class that contains main; then write the code for fibo.
public static void fibo(int[] arr) { // You write this }