The Basic Programming Language

Arithmetic Operations Example Program


Click below to go directly to a specific section:
Description | Source Code | Sample Run

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

[Back] [Home]

Last modified: 01:30 PM on 11/25/1996