Created
March 9, 2011 13:02
-
-
Save tormaroe/862143 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ SET SOURCEFORMAT"FREE" | |
IDENTIFICATION DIVISION. | |
PROGRAM-ID. Multiplier. | |
AUTHOR. Michael Coughlan. | |
* Example program using ACCEPT, DISPLAY and MULTIPLY to | |
* get two single digit numbers from the user and multiply them together | |
DATA DIVISION. | |
WORKING-STORAGE SECTION. | |
01 Num1 PIC 9 VALUE ZEROS. | |
01 Num2 PIC 9 VALUE ZEROS. | |
01 Result PIC 99 VALUE ZEROS. | |
PROCEDURE DIVISION. | |
DISPLAY "Enter first number (1 digit) : " WITH NO ADVANCING. | |
ACCEPT Num1. | |
DISPLAY "Enter second number (1 digit) : " WITH NO ADVANCING. | |
ACCEPT Num2. | |
MULTIPLY Num1 BY Num2 GIVING Result. | |
DISPLAY "Result is = ", Result. | |
STOP RUN. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment