Computers and Technology

What is stored in alpha after the following code executes?

int[] alpha = new int[5];
int j;

for (j = 0; j < 5; j++)
{
alpha[j] = 2 * j;

if (j % 2 == 1)
alpha[j - 1] = alpha[j] + j;
}

1. alpha = {0, 2, 4, 6, 8}
2. alpha = {0, 2, 9, 6, 8}
3. alpha = {3, 2, 9, 6, 8}
4. alpha = {0, 3, 4, 7, 8}

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 13:30, AsiaDeas4078
Write lines of verse that rhyme to remember the following information: acid rain is a type of air pollution caused by chemicals in the air.
Answers: 1
image
Computers and Technology, 23.06.2019 22:30, kayelynn003
How many points do i need before i can send a chat
Answers: 1
image
Computers and Technology, 24.06.2019 12:00, elainnysanchez1541
How can we take picture in this app
Answers: 1
image
Computers and Technology, 24.06.2019 19:30, sipstick971
Dtp allows you to manipulate text boxes in the following ways. more than 1 answer. a. move them b. rotate them c. resize them d. all of the above e. none of the above
Answers: 1
Do you know the correct answer?
What is stored in alpha after the following code executes?

int[] alpha = new int[5];...

Questions in other subjects:

Konu
Mathematics, 11.06.2020 07:57
Konu
Mathematics, 11.06.2020 07:57
Konu
Mathematics, 11.06.2020 07:57