Programming Course for Beginners - ZedLX

The Easiest Online Computer Programming Course, for Free

Variables [2/14]

Two variables cannot have identical names.

Click on the Check button to see the error description.

Correct the example by changing the name of the second variable, and then output its value to the screen.

Variable names and other names are case sensitive. Therefore, 'a' and 'A' are two different names.

* * *

-- Assignment vs Intoducing Variables --

Another way to correct this error would be to just use an assignment instead of introducing a new variable. A new variable is introduced by a statement of new variables, for example:

    #num a=5;

An assignment is performed by a statement of assignment. Notice the difference: