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

Given f(x) = |x| and g(x) = 2x-3. Solve for (f ⚬ g)(x)
What was the federalist response to the anti-federalist?
Find Cos N 73 48 E 55
Which of the following is not an element of academic argument? A. Use of logic B. Evidence C. Debatable statement D. Propaganda
Residents who live in the city receive power from the city’s power plant. If the city is a square, approximately how wide is the city if the area is 200 square
Please help guys lol I have no clue how to do this... it’s the square root method?
Aubrey's car used 4 gallons to travel 100 miles. How many miles can the car go on one gallon of gas?
A class has 30 boys and 20 girls. The average age ofboys is 11 yrs and girls 12 What is theaverage age of the whole class."​
Find LM. 2x-16 x-9 11 L M N
Bismuth oxide reacts with carbon to form bismuth metal: Bi2O3(s) + 3C(s) → 2Bi(s) + 3CO(g) When 775 g of Bi2O3 reacts with excess carbon, (a) how many moles of