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

one week she had 38 coins, all of them dimes and quarters. when she added them up, she had a total of 6.95, how many dimes did she have
What is the mode for the following set of data? 2, 5, 7, 8, 11, 11, 12 PLEASE HELP!!!!!!!!!!
Name and briefly describe three digestive system problems common to middle aged adults. name and briefly describe one common to teenagers name and briefly descr
Which is the most specific taxonomic level that includes apes, monkeys, orangutans, and humans?
Did the German public know about the concentration camps?
One reason many native born American in the late 1800s were in favour of restricting immigration?
What is arthur c. clarke's persuasive appeal;?
520 miles in 8 hours. what is your unit rate (mph)?
What is the answer to this question ?
What is a key feature of the European Renaissance culture?