I
Program Prog24;
uses wincrt;
var
k:integer;
nama : char;
gaji :longint;
totgaji: longint;
begin
clrscr;
k:=0;
totgaji:=0;
repeat
k:=k+1;
writeln('Data ke :',k);
write('Nama pegawai: ');
readln(nama);
write('Gaji Pokok : ');
readln(gaji);
totgaji:=totgaji+gaji;
until
k>4;
writeln('Jumlah Data : ',k);
write('Total Gaji yang harus dibayar : ');
writeln(totgaji);
readln;
end.
II
Program
Piramida;
uses wincrt;
var i,j,tinggi,lok:byte;
begin
clrscr;
write('Tinggi Piramida(2..10) : ');
repeat
gotoxy(26,1);clreol;
readln(tinggi);
until tinggi in[2..10];
for
i:=1 to tinggi do
begin
lok:=40-i;
for j:=1 to i do
begin
gotoxy(lok,i);
write('*');
lok:=lok+2;
end;
end;
readln;
end.
Tidak ada komentar:
Posting Komentar
Semoga Bermanfaat