59 As well as printing variables and string variables as shown above the computer can print any characters placed in between double quotes exactly as they have been typed in, provided they are in a PRINT statement. The next program asks for your name and remembers it in the string variable . 10 PRINT "WHAT IS YOUR NAME"; 20 INPUT N$ 30 PRINT "HELLO";N$;". HOW ARE YOU?" >RUN WHAT IS YOUR NAME ?JOHN HELLO JOHN. HOW ARE YOU? Notice the semi-colon at the end of line 10 that makes the computer stay on the same line while it waits for you to provide it with a value for . Without the semi-colon this happens: >RUN WHAT IS YOUR NAME ?JOHN HELLO JOHN. HOW ARE YOU?
Note also the space after the word HELLO and before the word HOW in line 30. Without these spaces the words run together to produce HELLOJOHN.HOW ARE YOU? It is also legitimate to do calculations in a print list – for example 10 X=4.5 20 PRINT X,X+2,X/3,X*X > >RUN 4.5 6.5 1.5 20.25 but look what happens if instead of X=4.5 we put X = 7 10 X=7 20 PRINT X,X+2,X/3,X*X >RUN 7 92.33333333 49 because X/3 is 2.33333333 it makes the number move left in the field until it immediately follows the previous field which contains a 9 and appears to give a result 92.33333333, which is misleading. For this reason, amongst others, the next section is important if you want to print out a lot of numbers.