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
The code youre asking about is programmed to create and fill an array with the first n numbers in ... View full answer
Get step-by-step solutions from verified subject matter experts
