Question: What output is produced by the following code? int i; int [ ] anArray = new int [5]; for (i = 0; i < anArray.Length;

What output is produced by the following code?

int i;

int [ ] anArray = new int [5];

for (i = 0; i < anArray.Length; i++)

anArray[i] = 2 * i;

for (i = 0; i < anArray.Length; i++)

Write(anArray[i] + " ");

a. 22222

b. 246810

c. 0246810

d. 02468

e. none of the above

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 Systems Analysis Design Questions!