fork download
  1. IDENTIFICATION DIVISION.
  2. PROGRAM-ID. IDEONE.
  3. ENVIRONMENT DIVISION.
  4. DATA DIVISION.
  5. WORKING-STORAGE SECTION.
  6. 01 a Pic x(45) value "TheCobol Add/Multiply Program.".
  7. 77 b Pic zz9.
  8. 77 c Pic zzz9.
  9. 77 n PIC Z9 .
  10. PROCEDURE DIVISION.
  11. Add 25 TO 25 giving b.
  12. Multiply 35 By 35 giving c.
  13. Display "25 Plus 25 Equals ",b.
  14. Display "35 Times 35 Equals ",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 5276KB
stdin
10
43
5
42
1
stdout
25 Plus 25 Equals  50
35 Times 35 Equals 1225
10
43
 5