Questions: Variables and Assignment

3 questions to test your understanding

Score: 0 / 3
Question 1 Multiple Choice

What is the value of x after these three lines execute? x = 10 y = x x = 20

Ax is 10, y is 10
Bx is 20, y is 20
Cx is 20, y is 10
Dx is 10, y is 20
Question 2 True / False

In most programming languages, the statement x = x + 1 is a valid assignment.

TTrue
FFalse
Question 3 Short Answer

Explain why the order of assignment statements matters. Give a brief example.

Think about your answer, then reveal below.