ethanspencer8254 ethanspencer8254
  • 18-07-2019
  • Computers and Technology
contestada

int alpha [5];

int j;
alpha [0] = 2
for ( j = 1; j < 5; j++)
alpha [j] = alpha [ j - 1] + 3;
3. What is the value ofalpha[4] after the code aboveexecutes?

a.

5

c.

11

b.

8

d.

14

Respuesta :

demimurray573
demimurray573 demimurray573
  • 28-07-2019

Answer:

D - 14

Explanation:

Each time the program executes an iteration of the for-loop, it works out the current element by adding 3 to the previous element.

alpha[0] = 2

+3

alpha[1] = 5

+3

alpha[2] = 8

+3

alpha[3] = 11

+3

alpha[4] = 14

Answer Link

Otras preguntas

Dephosphorylation occurs when ATP molecules convert into ADP molecules. true or false
how are sound waves and electromagnetic waves different?
Marks: 6 Find the equation in standard form which passes through (-2, -7) and (1, -1). You must show all work.
how do you solve this equation thankyou. 5n+34=-2(1-7n)
Keith spends 1/6 of his savings on a magazine 2/5 of the remainder on a storybook what fraction of his savings is left
Which was NOT a major accomplishment of Byzantine culture? 1. The Hagia Sophia 2. Justinian's Code 3. spectacular mosaics 3. the building of Moscow
Which statements describe factors that led to the decline and defeat of the Aztec Empire? Choose all answers that are correct. A. The Aztecs had never seen stee
Does the color of water affect its evaporation?
A triangular sail has a perimeter of 25 m. Side a is 2 m shorter than twice side b, and side c is 3 m longer than side b. Find the length of each side.
A line passes through points (6,3), (8,4), and (n,-2). How do I find the value?