Hello World Example program
Description
This program prints the
phrase "Hello World" infinitely.
Source Code
10 PRINT "Hello World!"
20 GOTO 10
Sample Run
Hello World!
Hello World!
Hello World! etc., etc....
Arithmetic Operations
Example Program
Description
This program performs
basic arithmetic operations.
Source Code
10 INPUT "ENTER TWO NUMBERS SEPARATED BY A COMMA:
20 LET S = N1 + N2
30 LET D = N1 - N2
40 LET P = N1 * N2
50 LET Q = N1 / N2
60 PRINT "THE SUM IS ", S
70 PRINT "THE DIFFERENCE IS ", D
80 PRINT "THE PRODUCT IS ", P
90 PRINT "THE QUOTIENT IS ", Q
100 END
Sample Run
ENTER TWO NUMBERS SEPARATED BY A COMMA:
4 2
THE SUM IS 6
THE DIFFERENCE IS 2
THE PRODUCT IS 8
THE QUOTIENT IS 2
Walang komento:
Mag-post ng isang Komento