EasyManua.ls Logo

VTech PreComputer Prestige - Making Decisions with IF Statements

VTech PreComputer Prestige
93 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
41
Try this:
NEW
10 INPUT "GIVE ME A NUMBER"; N1
20 INPUT "AND ANOTHER"; N2
30 PRINT "I WILL ADD THEM"
40 C=N1+N2
50 PRINT "THE ANSWER IS"; C
Type RUN and press Enter to see what happens.
7. MAKING DECISIONS
The IF statement tells the computer that it has to make a decision. It does this by comparing
two numbers, arithmetic expressions or string variables. It uses special symbols to represent
a condition.
The symbol > means greater than.
The symbol < means less than.
The symbol = means equal to.
The symbol > = means greater than or equal to.
The symbol < = means less than or equal to
Here are some conditions:
5 < 10 20 > 10
They are both true because
5 is less than 10
20 is greater than 10

Related product manuals