Lingkaran
program luas_lingkaran;
uses crt;
const
phi = 3.14;
var
jari,hasil : real;
begin
clrscr;
write('Input jari = ');readln(jari);
hasil :=phi * jari * jari;
write('Hasil = ',hasil);
readln;
end.
Persegi
program keliling_persegi;
uses crt;
var
sisi,hasil : integer;
begin
clrscr;
write('input nilai sisi = '); readln(sisi);
hasil := sisi*4;
write('Hasil = ',hasil);
readln;
end.
uses crt;
var
sisi,hasil : integer;
begin
clrscr;
write('input nilai sisi = '); readln(sisi);
hasil := sisi*4;
write('Hasil = ',hasil);
readln;
end.
Tabung
program tabung;uses crt;
const
phi = 3.14;
var
r,t,c : real;
begin
clrscr;
write('Input jari-jari = ');readln(r);
write('Input Tinggi = ');readln(t);
c := phi * r * r * t;
write('hasil = ',c);
readln;
end.
0 comments:
Posting Komentar