Question: Given the following code blocks. Determine the output. a) int i; int [] N = new int [10]; N [0] = 1; N [1] =

Given the following code blocks. Determine the output.

a)

int i;

int [] N = new int [10];

N [0] = 1;

N [1] = 1;

for(i = 2; i < 10; i++)

N [i] = N [i 1] + N [i 2];

for(i = 0; i < 10; i++)

System.out.println(N [i]);

b)

int p, q, count;

int [] [] b = new int [5] [3];

for(p = 0; p < 5;p++)

count = 5;

for(q = 0;q < 3;q++)

{

count = count + p + q;

b[p] [q] = count;

System.out.println(b [p] [q] + );

}

System.out.println();

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!