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

________ current form of government is a theocracy.
Which of the following controlled the economy of the Byzantine Empire? A) the emperor B) the Chistian church C) guilds of merchants and craftsmen D) the Byz
In 1881 President Garfield was assassinated by a man who was angry that Garfield had not given him a government job. Two years later, lingering anger over this
French diplomats demanded a bribe to begin talks with the U.S. diplomats in the _____.
5x + 6y = -18 Write the intercep form of the equation of each line
In 1914, Americans believed that the Monroe Doctrine encouraged them to follow a policy of
José __________ (entregar) la tarea.
A certificate of deposit pays a higher interest rate than a savings account because the money is
What is the completely factored form of 3x^2-12x-15
________ current form of government is a theocracy.