PROGRAM PROCEDURE_DAN_FUNCTION;
USES WINCRT;
PROCEDURE MENU;
BEGIN
GOTOXY(25,8);WRITE('1. LUAS PERSEGI');
GOTOXY(25,10);WRITE('2. LUAS SEGITIGA');
GOTOXY(25,12);WRITE('3. BILANGAN PANGKAT');
GOTOXY(25,14);WRITE('4. BILANGAN POSITIF NEGATIF');
GOTOXY(25,16);WRITE('5. KELUAR');
END;
FUNCTION LUAS_PERSEGI (S:INTEGER):LONGINT;
BEGIN
LUAS_PERSEGI:=SQR(S);
END;
FUNCTION SEGITIGA (A,T:INTEGER):LONGINT;
BEGIN
SEGITIGA:=A*T;
END;
PROCEDURE BIL_PANGKAT (A,B,C:LONGINT);
VAR I:INTEGER;
BEGIN
C:=1;
FOR I:=1 TO B DO BEGIN
C:=C*A;
END;
WRITE(A,' ^ ',B,' = ',C);
END;