Wednesday, 21 November 2012

Jawaban Quis I Prak. DDPK

PROGRAM QUIS;
USES CRT;
VAR A,B,C,D,E,F,G,H: INTEGER;
X,Y,Z: INTEGER;
BEGIN
CLRSCR;
WRITELN(' PROGRAM PERULANGAN ');
WRITELN('====================');
WRITELN('DIBUAT OLEH : RACHMAD ALMI PUTRA');
WRITE('MASUKKAN NILAI TERKECIL : '); READLN(X);
WRITE('MASUKKAN NILAI TERBESAR: '); READLN(Y);
WRITELN('=========================================');
WRITELN('         A        B         C         D ');
WRITELN('=========================================');
FOR Z:=X TO Y DO
BEGIN
A:=2*Z-1;
B:=SQR(A)+Y*2;
C:=A+(B);
D:=(A+C)+(B+D);
WRITELN(A:10,B:10,C:10,D:10);
E:=E+A;
F:=F+B;
G:=G+C;
H:=H+D;
END;
WRITELN('=========================================');
WRITELN(E:10,F:10,G:10,h:10);
READLN;
END.

0 komentar: