8.2k views
25 votes
In the code below, what's the final value of the variable x?

var x = 8;

x = x - 6;

x = x * 3;

1 Answer

3 votes

Answer:

First equation x=4

second equation x=3

Step-by-step explanation:

The question is telling us that 'X' is equal to 8. It's another way of representing this number using X as the variable replacing it.

We input 8 instead of the X to solve the equation, and here in the picture, you can see where I went from there.

Do the same thing for the other equation.

I hope this helps :)

In the code below, what's the final value of the variable x? var x = 8; x = x - 6; x-example-1
User Freylis
by
3.9k points