Question: Which values does the following code put in the array a[]? int n = 10; int[] a = new int[n]; a[0] = 1; a[1] =

Which values does the following code put in the array a[]?

int n = 10;

int[] a = new int[n];

a[0] = 1;

a[1] = 1;

for (int i = 2; i < n; i++)

a[i] = a[i-1] + a[i-2];

Step by Step Solution

3.28 Rating (151 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The code youre asking about is programmed to create and fill an array with the first n numbers in ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Introduction To Programming Questions!