1.03.2011

Coret #1

{program perbandingan}
program perbandingan;
uses wincrt;

var
a1,t1,l1,a2,t2,l2,a3,t3,l3,a4,t4,l4 :real;
tb,lg:string;
begin

lg:='ya';

while (lg='ya') or (lg='y') do

begin
clrscr;

writeln ('Membandingkan Luas Segi Tiga');
writeln;
write ('Alas 1 : ');readln (a1);
write ('Tinggi 1 : ');readln (t1);
l1:=(a1*t1)/2;
writeln ('Luas : ',l1:1:2);

writeln;
write ('Alas 2 : ');readln (a2);
write ('Tinggi 2 : ');readln (t2);
l2:=(a2*t2)/2;
writeln ('Luas : ',l2:1:2);

writeln;
write ('Alas 3 : ');readln (a3);
write ('Tinggi 3 : ');readln (t3);
l3:=(a3*t3)/2;
writeln ('Luas : ',l3:1:2);

writeln;

write ('Alas 4 : ');readln (a4);
write ('Tinggi 4 : ');readln (t4);
l4:=(a4*t4)/2;
writeln ('Luas 4 : ',L4:1:2);

writeln;

if (l1>l2) and (l1>l3) and (l1>l4) then

tb:='Luas 1'

else

if (l2>l1) and (L2>L3) and (l2>l4) then

tb:='Luas 2'

else

if (l3>l1) and (L3>L2) and (l3>l4) then
tb:='Luas 3'

else

if (l4>l1) and (l4>l2) and (l4>l3) then
tb:='Luas 4';


writeln ('Yang terbesar adalah : ',tb);

writeln;

write ('Ulang ? [ya/t] : '); readln (lg);
end;

end.


*(mengunakan aplikasi TPW (turbo pascal for windows)

"cari disini"

-selamat mencoba-