Page 62 - 1
P. 62

The program will ask the user to enter the input. The user will enter the value that the user
   wants to assign to the variable or string.
   REM Statement
   REM statement is used to enter remarks or comments in the program.
   Syntax
   REM My first program
   It will display My first program on the output screen.
   Control Statements
   The control statements are used to change the order of the execution of the commands of
   the program. There are four control statements:
   GOTO
   IF...THEN
   IF... THEN... ELSE
   ELSE IF with IF... THEN
   Let’s read about these statements in detail.
   GOTO
   GOTO statement is used to transfer the control of a program from one statement to another
   statement.
   Syntax
   GOTO <Line number>
   Example
   1 A=5
   2 B=6
   3 C=A+B
   4 D=A*1
   5 GOTO 3
   6 END
   In the above program the execution will move back to line number 3 whenever the program
   executes line number 5.
   IF... THEN
   IF... THEN statement is used to display the output
   based on comparisons.
   Syntax
   IF <Condition> THEN <Statement>
   Example
   IF A > 10 THEN B = B - 1
   IF A < 10 THEN B = B + 1
   If the value of A is more than 10 then 1 would be subtracted from the value of B.
   If the value of A is less than 10 then 1 would be added to the value of B.

62
   57   58   59   60   61   62   63   64   65   66   67