Senin, 08 April 2013

contoh program Modular(2 procedure) Pascal

program latihan_modular;
uses wincrt;
var
a,b,c:integer;
procedure tambah;
var
c:byte;
begin
c:= a+b;
Writeln('Hasil a+b : ',c);
end;
procedure garis;
begin
writeln('=============================');
end;
procedure kurang;
begin
c:=a-b;
writeln('Hasil a-b : ',c);
end;
begin
writeln('Program Matematika Sederhana');
garis;
write('Nilai 1 : ');readln(a);
write('Nilai 2 : ');readln(b);
garis;
tambah;
garis;
kurang;
garis;
readln;
end.

Tidak ada komentar:

Poskan Komentar