fork(1) download
  1. $ SET SOURCEFORMAT"FREE"
  2. IDENTIFICATION DIVISION.
  3. PROGRAM-ID. Multiplier.
  4. AUTHOR. Michael Coughlan.
  5. * Example program using ACCEPT, DISPLAY and MULTIPLY to
  6. * get two single digit numbers from the user and multiply them together
  7.  
  8. DATA DIVISION.
  9.  
  10. WORKING-STORAGE SECTION.
  11. 01 Num1 PIC 9 VALUE ZEROS.
  12. 01 Num2 PIC 9 VALUE ZEROS.
  13. 01 Result PIC 99 VALUE ZEROS.
  14.  
  15. PROCEDURE DIVISION.
  16. DISPLAY "Enter first number (1 digit) : " WITH NO ADVANCING.
  17. ACCEPT Num1.
  18. DISPLAY "Enter second number (1 digit) : " WITH NO ADVANCING.
  19. ACCEPT Num2.
  20. MULTIPLY Num1 BY Num2 GIVING Result.
  21. DISPLAY "Result is = ", Result.
  22. STOP RUN.
  23.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
2 2
compilation info
prog.cbl:     1: error: syntax error, on or before '$'
stdout
Standard output is empty