billowusu6280 billowusu6280
  • 12-07-2019
  • Computers and Technology
contestada

In which of the following is “y” not equal to 5 after execution? X is equal to 4.

a) y = ++x; b) y = x = 5; c) y = 5; d) y = x++;

Respuesta :

Branta Branta
  • 25-07-2019

Answer:

d) y=x++

Explanation:

In all 3 statements:

y= ++x;

y=x=5;

y=5;

The value of y is equal to 5.

However in the statement y=x++, the value of 5 is equal to value of x prior to the increment operation. The original value of x was 4. So the value of y will be 4. Note that after the statement execution, the value of x will be updated to 5. In effect y=x++ can be visualized as a sequence of following steps:

x=4;

y=x;

x=x+1;

Answer Link

Otras preguntas

need help with this questiona milk man delivers 109865 bottles of milk a yearwrite the numbers of bottles toothe nearest 100the nearest 1000the nearest 10the ne
number sequesnce...what next #?4 6 10 18 34 66 130
A lever used to lift a heavy box has an input arm of 4 meters and an output arm of 0.8 meters. What is the mechanical advantage of the lever?
Realidades 2 workbook page 9 Los chicos deben _ _ _ _ _er al profesor como el sr.rios What word ends in er and fils the blanks as shown above?
What is the digit in 913 and where's the digit in the tens place and the value of the digit tens someone answer for my homework
fats are made of an alcohol called ?
A charge of 0.01 C is in a 120 N/C electric field. What is the force on the charge?
What is 694,563,239 rounded to the nearest thousand
What means "A fair exterior is a silent recommendation."(½ or 1 page).
A charge of 0.01 C is in a 120 N/C electric field. What is the force on the charge?