cours0708/P5B/cobol/exercices/mult.cbl

25 lines
699 B
Plaintext
Raw Permalink Normal View History

2008-11-25 21:11:16 +00:00
IDENTIFICATION DIVISION.
PROGRAM-ID. mult.
AUTHOR. GR.
* Ce programme effectue la multiplication de 2 entiers
*
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
77 Num1 PIC 999 VALUE ZERO.
77 Num2 PIC 999 VALUE ZERO.
77 Res PIC Z(5)9.
PROCEDURE DIVISION.
PROGRAMME SECTION.
P1.
DISPLAY "Taper le 1er nombre (<999) : " WITH NO ADVANCING.
ACCEPT Num1.
DISPLAY "Taper le second nombre : " WITH NO ADVANCING.
ACCEPT Num2.
MULTIPLY Num1 BY Num2 GIVING Res.
DISPLAY "R<>sultat = " Res.
STOP RUN.