Program Bilangan (pascal)

Contoh script Program Bilangan (pascal)

Uses crt;
Var
bil, panjang, lebar, pilih, luas:integer;

begin
clrscr;
writeln(‘1.Luas Lingkaran’);
writeln(‘2.Bil genap-ganjil’);

write(‘Pilih menu 1 atau 2);

case pilih of
1:begin
Writeln(‘mencari luas Persegi Panjang’);
Writeln(‘============================’);
Writeln(‘masukkan panjang: ’);readln(panjang);
Writeln(‘masukkan lebar: ’);readln(lebar);
Luas:=panjang*lebar;
Write(‘Luasnya adalah : ‘, luas);
end;
Writeln(‘mencari Bilangan genap-ganjil’);
Writeln(‘==============================’);
Writeln(‘masukkan bilangan : ’);readln(bil);
if bil mod 2=0 then
write(‘Bilangan ‘,bil,’merupakan Bilangan Genap’);
 else
write(‘Bilangan ‘,bil,’merupakan Bilangan Ganjil’);
 end;
end;
readln;
end.




Share on Google Plus

About Mustafa RF

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment