PROGRAM BILANGAN GANJIL ATAU GENAP PADA COBOL
IDENTIFICATION DIVISION.
PROGRAM-ID. GANJIL.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 BILANGAN.
02 A PIC 99.
02 HASIL PIC 99 VALUE 0.
02 SISA PIC 99 VALUE 0.
02 BIL PIC X(6).
PROCEDURE DIVISION.
MULAI.
DISPLAY (1, 1) 'MASUKKAN BILANGAN : '.
ACCEPT A.
DISPLAY SPACE.
DIVIDE 2 INTO A GIVING HASIL REMAINDER SISA.
IF SISA = 0
MOVE 'GENAP' TO BIL
ELSE
MOVE 'GANJIL' TO BIL.
DISPLAY A, ' ADALAH BILANGAN ', BIL.
SELESAI.
STOP RUN.
OUTPUT :
MASUKKAN BILANGAN : 13
13 ADALAH BILANGAN GANJIL
Sunday, 11 October 2009
PROGRAM BILANGAN GANJIL/GENAP PADA COBOL
Subscribe to:
Post Comments (Atom)
0 comments:
:)) :)] ;)) ;;) :D ;) :p :(( :) :( :X =(( :-o :-/ :-* :| 8-} ~x( :-t b-( :-L x( =))
Post a Comment