20 October, 2010

Program Segitiga Angka dan Menghitung rata-rata dalam Pascal

Source Code,,udah beda ni gan ama program buatan ane...ini dasar nya ja gan......GOOD LUCK..\m/

uses crt;
var a,b,c,d,e,x,f: integer;
nilai,total,rata:real;
jwbn:char;
begin
repeat
clrscr;
write('Masukkan tinggi = ');
readln(x);
writeln();
begin
for a:= x downto 1 do
begin
for b:= 1 to a do
write(a*b:1);
writeln;
end;
end;
readkey;
clrscr;
begin
total:=0;
write ('Masukkan Banyak Angka = ');readln(f);
for d :=1 to f do
begin
write(' >> Masukkan Angka ke-',d,' = ');readln(nilai);
total:=total+nilai;
end;
rata:=total/f;
writeln(' ---------------------------- +');
writeln(' :: Jumlah Semua Angka = ',total:0:0);
writeln(' :: Rata-rata = ',rata:1:2);
end;
writeln;
writeln;
write(' Ulang Lagi ? (y/t) : ');readln(Jwbn);
until (Jwbn)='t';
begin
clrscr;
end;
end.

Download dan Test Program nya!!!

No comments:

Post a Comment