Given variables x, y, and z. What is the end value of y? x = 9 y = x + 1 x = 5 A. 9 B. 10

Question

Given variables x, y, and z. What is the end value of y?

x = 9
y = x + 1
x = 5

A. 9

B. 10

C. 5

D. 1

in progress 0
Euphemia 3 months 2021-09-01T08:00:55+00:00 1 Answers 0 views 0

Answers ( )

    0
    2021-09-01T08:02:03+00:00

    9514 1404 393

    Answer:

      B. 10

    Step-by-step explanation:

    If this is a list of statements in a programming language that is processed sequentially, y is assigned the value 9+1 = 10. There is no further assignment to y, even after the value of x is changed. So, the final value of y is 10.

    __

    Additional comment

    Some programming languages do their processing in parallel, so that the definition of y would be updated when the value of x gets updated. In that case, the value of y would be changed to 5+1 = 6. Since this is not a choice, the problem is apparently supposed to be interpreted as above.

Leave an answer

Browse

Giải phương trình 1 ẩn: x + 2 - 2(x + 1) = -x . Hỏi x = ? ( )