sLangt8aylegrac sLangt8aylegrac
  • 04-01-2017
  • Computers and Technology
contestada

What will the value of x be after the following statements execute? int x = 0; int y = 5; int z = 4; x = y z * 2;

Respuesta :

kaevras
kaevras kaevras
  • 08-01-2017
Technically you'd get a compile error, due to the absence of a semi-colon after the forth statement (x = y z * 2; is invalid). Additionally, z * 2; is an invalid statement, as all programming languages that I know require you to specify the new value of z, such as (z = z * 2) or (z *= 2).

If we assume there's a semi-colon there, then the value of x after the following statements would be 5, as we are setting x's value to the value of y (which is 4), and x is never again modified in those statements.
Answer Link

Otras preguntas

how does the band feel about bud in bud not buddy
Which verb form correctly completes the sentence? Is the verb singular or plural? A bedroom with a green ceiling and purple walls __________ been his request s
what is 1 and 1/6 minus 7/12 ?
What are the layers of the earth and what are they made out of?
Atomic Theory is A- subject to change if new information is discovered. B- a solution to the problem of differing isotopes. C- Unchangeable D- a descriptive tab
The DNA sequence TCAGCCACCTATGGA codes for how many amino acids?
What is a large body that orbits a star and does not produce it's own light
Is new york city a rural, urban or suburban community?explain.
Any ideas for a science fair project involving anything with anime, anime art, baking, desserts, something about cuteness, or anything else that might be good!
five sixths plus one twelfths