A bit of a random question guys, help?

Here is a series of three steps:

Step 1: A = 10
Step 2: B = 20
Step 3: A = B

A and B are variables, that is they can stand for any value.
The “=” sign stands for assignment. It means “assign the value on the right to the variable on the left”.

After all three steps above have been completed, what are the values of A and B? *

A = 30, B = 0
A = 30, B = 20
A = 20, B = 20
A = 20, B = 0
A = 10, B = 10
A = 10, B = 20
A = 20, B = 10
A = 0, B = 10

Homework ? :grin:

Seems pretty straight forward. What’s this turn out to be?

Step 1: A = 10
Step 2: B = 20
Step 3: A = B

Step 1/2 makes it…
A=10 B=20

So what does step 3 do? It assigned the value of B, to the A variable. Which means A will get updated (B stays the same). So …I’m not gonna spoon feed it for you because this is obviously homework. Should be straight forward though from here.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.