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

The y-Int and the slope of C=7n+20 If you can show the formula
First, the cattle drive would ______. A. cross the Potomac River B. cross the Red River C. arrive in Missouri D. cross the state of Oklahoma
An equation is shown below: 5(2x - 8) + 15 = -15 Write the steps you will use to solve the equation and explain each step.
help please!! correct answer gets brainliest :) (show work)
4[5(x + 3) - 2] + 3(x - 1)
Which 2 statements are true when creating an OAuth bank connection in QuickBooks Online?
Are the words "interesting" and "pleasing" correlated or similar?
Which of the following were accomplishments of Arthur Clarke? Select two answers
what rational number is halfway between 1/5 and 1/3?
Which states would be the most likely to experience the next volcanic eruption AND earthquake in the United States? List at least 3 for each hazard and explain