Variables (continued)

You can do one more thing with variables. It is the core meaning of it: to vary (change). You can update a variable by assigning it a new value:

When you run the program you should see 2 numbers printed:

Of course, you can assign complex expressions (calculations), which can include variables too!

CodeExploreLearnLog In