fork download
  1. IDENTIFICATION DIVISION.
  2. PROGRAM-ID. IDEONE.
  3. ENVIRONMENT DIVISION.
  4. DATA DIVISION.
  5. WORKING-STORAGE SECTION.
  6. 77 ws-a Pic 9v99 value 3.14.
  7. 77 ws-c Pic 99 value 12.
  8. 77 ws-d Pic 99 value 13.
  9. 77 ws-vol Pic 9999 value zeros.
  10. 77 n PIC Z9 .
  11. PROCEDURE DIVISION.
  12. display "The Cobol Volume Of A Cylinder.".
  13. Display ws-a" "ws-c" "ws-d.
  14. Compute ws-vol = ws-c**2 * ws-d * ws-a.
  15. Display "The Volume Of A Cylinder ",ws-vol.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 5284KB
stdin
10
43
5
42
1
stdout
The Cobol Volume Of A Cylinder.
3.14 12 13
The Volume Of A Cylinder 5878
10
43
 5