Hai Sahabat Blogger... Bagi yang kuliah Jurusan Sistem Informasi/Manajemen Informasi/Teknik Informatika, pasti tidak asing lagi dengan yang namanya pascal kan ???
Disini saya ingin berbagi contoh-contoh Program Pascal, silahkan bagi yang perlu bisa langsung dicopast script nya :)
Program Hitung Dasar
program hitung;
uses winCrt;
var
a,b,c,d,e,f,h,i,j,k,l : integer;
g : real;
uses winCrt;
var
a,b,c,d,e,f,h,i,j,k,l : integer;
g : real;
Begin
writeln ('Program Hitung Dasar');
writeln ('=====================');
write ('nilai B = ') ; readln (B);
write ('nilai C = ') ; readln (C);
write ('nilai E = ') ; readln (E);
write ('nilai F = ') ; readln (F);
write ('nilai H = ') ; readln (H);
write ('nilai I = ') ; readln (I);
write ('nilai K = ') ; readln (K);
write ('nilai L = ') ; readln (L);
write ('=====================');
A := B+C;
D := E*F;
G := H/I;
J := K-L;
writeln;
writeln ('Hasil A = B+C = ', A);
writeln ('Hasil D = E*F = ', D);
writeln ('Hasil G = H/I = ', G :2:2);
writeln ('Hasil J = K-L = ', J);
writeln ('===================');
writeln ('Program Hitung Dasar');
writeln ('=====================');
write ('nilai B = ') ; readln (B);
write ('nilai C = ') ; readln (C);
write ('nilai E = ') ; readln (E);
write ('nilai F = ') ; readln (F);
write ('nilai H = ') ; readln (H);
write ('nilai I = ') ; readln (I);
write ('nilai K = ') ; readln (K);
write ('nilai L = ') ; readln (L);
write ('=====================');
A := B+C;
D := E*F;
G := H/I;
J := K-L;
writeln;
writeln ('Hasil A = B+C = ', A);
writeln ('Hasil D = E*F = ', D);
writeln ('Hasil G = H/I = ', G :2:2);
writeln ('Hasil J = K-L = ', J);
writeln ('===================');
writeln ('Hasil ',B,' + ',C,' =',A);
writeln ('Hasil ',E,' * ',F,' =',D);
writeln ('Hasil ',H,' / ',I,' =',G:2:2);
writeln ('Hasil ',K,' - ',L,' =',J);
writeln ('=====================');
end.
Hasilnya akan tampil seperti
gambar berikut !writeln ('Hasil ',E,' * ',F,' =',D);
writeln ('Hasil ',H,' / ',I,' =',G:2:2);
writeln ('Hasil ',K,' - ',L,' =',J);
writeln ('=====================');
end.
Berhasil tidak ?? Jika belum berhasil, atau ada yang Error.. silahkan koment saja :)
Terimakasih telah berkunjung ke Blog Saya....
No comments:
Post a Comment