How to write code in BASIC Programming Languages

How to write code in BASIC Programming Languages

10 CLS
20 PRINT “Hello, world!”
30 PRINT “I’m learning about commands in BASIC.”
40 PRINT “This text is being printed via the PRINT command.”
50 PRINT “On the next line, I’ll use CLS.”
60 CLS
70 PRINT “Finally, on line 80, I’ll use END.”
80 END
90 PRINT “Now my program is over.”

Line 10 the display is cleared.
Lines 20 through 50 shows first paragraph displayed.
Line 60 again clears the display.
Line 70 shows the message you should see after you run this program.
Line 80 Ends the program.
Line 90 This line helps to show that a END statement stops the program at that point.

==========qBasic===========
CLS
ASTRING$ = “Hello World”
ANUMBER% = 10
PRINT ASTRING$
PRINT ANUMBER%

==========freeBasic=======
Cls
Dim aString As String
Dim anInteger As Integer
aString = “John Doe”
anInteger = 42
Print aString
Print anInteger
Sleep
End


Discover more from mycodetips

Subscribe to get the latest posts sent to your email.

Discover more from mycodetips

Subscribe now to keep reading and get access to the full archive.

Continue reading

Scroll to Top