Page 104 - TechPluse_C6_Flipbook
P. 104

REM Statement

                  As you know that the # symbol is used to write comments in BASIC-256 programs. You can also use the
                  REM statement instead of the # symbol to write comments. For example:
                  REM "Comment"
                  END Statement


                  The END statement is used to specify the end point of the program. Statements written after the
                  END will not be executed by BASIC-256.  For example:
                  PRINT "Welcome"
                  END
                  PRINT "Touchpad"

                  Above statement will print only Welcome.
                  INPUT Statement


                  The INPUT statement is used to take the value from the user at run time.

                  For example:
                  INPUT Name$
                  PRINT Name$
                  When you execute the preceding statements, you need to enter the name in the Text Output
                  Area. After entering the name when you press the Enter key, the entered name will be printed.
                  We can also use message with the INPUT statement.
                  Example 1:
                  INPUT "Enter first number: ", num1

                  Example 2:
                  INPUT "Enter the temperature in Celsius: ", temp

                  PRINT "You entered: ", temp, "°C"
                  Output:
                  Enter the temperature in Celsius: 25

                  You entered: 25°C
                  Example 3:
                  INPUT "Enter the first number: ", num1

                  INPUT "Enter the second number: ", num2
                  PRINT "The sum is: ", num1 + num2
                  Output:

                  Enter the first number: 10
                  Enter the second number: 20
                  The sum is: 30






               102      Premium Edition-VI
   99   100   101   102   103   104   105   106   107   108   109