3. Getting started with gw basic
Start new version of BASIC just type “GW-BASIC’’
This leads interpreter BASIC and You will see OK prompt
Now type the following two lines
10 PRINT “Hello There’’
20 GOTO 10
To test its output type RUN
To save this program
SAVE “Hello’’
4. Getting started with gw basic
Then leave the BASIC interpreter by typing system or alt+X
To check your program or save program DIR h *.*
To RUN the program type
BASIC A Hello
RUN “Hello’’
5. PRINT Statement
Used to transmit or string output data on monitor’s screen
Consist of a statement numbers, keyword PRINT and a list of output items
The successive items must be separated by commas
Example:
100 PRINT X,Y,Z
110 PRINT “X= ‘’ X; “M=‘’ ; Y
120 PRINT “NAME’’ N$, “Address” A$
130 PRINT
6. RULES OF PRINT Statement
Each PRINT Statement begins a new line of output
Two or more lines generated by single INPUT Statement
PRINT Statement without data items print a blank line.
EXAMPLE:
10 LET X1=10
20 LET X2=20
30 LET X3=30
40 LET X4=40
50 LET X5=50
60 LET X6=100
70 PRINT X1, X2, X3, X4, X5, X6
OUTPUT:
10 20 30 40 50
100