The program will print out:
Value is: 5 Now the value is: 15
Notice that VALUE
is used in the first PRINT
statement,
then the number stored in VALUE
is changed by adding
10 to it,
then the second PRINT
statement prints the new number.
' More example LET statements LET VALUE = 5 PRINT "Value is:", VALUE ' LET VALUE = VALUE + 10 PRINT "Now the value is:", VALUE END
Look at the following program:
' Counting up LET COUNT = 0 'Statement 1 PRINT COUNT 'Statement 2 LET COUNT = COUNT + 1 'Statement 3 PRINT COUNT 'Statement 4 END
COUNT
and puts 0 into it.COUNT
.COUNT
,
adds 1 to it, and puts the
result back in COUNT
.COUNT
.When the program runs it prints:
0 1
Think of a way to print 0, 1, and 2 on the monitor.