fork download
  1. IDENTIFICATION DIVISION.
  2. PROGRAM-ID. IDEONE.
  3. ENVIRONMENT DIVISION.
  4. DATA DIVISION.
  5. WORKING-STORAGE SECTION.
  6. 01 a Pic x(46) value "The Cobol Compute Subtract/Divide.".
  7. 77 b Pic zz9.
  8. 77 c Pic zz9.
  9. 77 n PIC Z9 .
  10. PROCEDURE DIVISION.
  11. Compute b = (90 - 45).
  12. Compute c = (2025 / 45).
  13. Display "Subtract 45 From 90 Equals: ",b.
  14. Display "Divide 2025 By 45 Equaks: ",c.
  15. ACCEPT n
  16. PERFORM UNTIL n = 42
  17. DISPLAY n
  18. ACCEPT n
  19. END-PERFORM.
  20. STOP RUN.
  21.  
Success #stdin #stdout 0.01s 5280KB
stdin
10
43
5
42
1
stdout
Subtract 45 From 90 Equals:  45
Divide 2025 By 45 Equaks:  45
10
43
 5