Selasa, 06 Januari 2015

PENULISAN PROCEDURE & FUNCTION MODEL PROCEDURE BY VALUE (VARIABEL GLOBAL)

program Project12;
{$APPTYPE CONSOLE}
uses
  SysUtils;
var
    X,Y:integer;
  procedure jumlah(A,B:integer) ;
    var
      C:integer;
    begin
      C:= A+B;
      writeln('Hasil Penjumlahan = ',C);
    end;
begin
  writeln ('NIM  : 114224008');
  writeln ('NAMA : AZIZUN NURRACHMAN');
  writeln ('=====================================');
  writeln ('CONTOH PENULISAN PROCEDURE & FUNCTION');
  writeln ('       MODELPROCEDURE BY VALUE       ');
  writeln ('=====================================');
  writeln ('');
  write('Masukkan Nilai X  = '); readln(X);
  write('Masukkan Nilai Y  = '); readln(Y);
  jumlah(X,Y);
  readln;
  { TODO -oUser -cConsole Main : Insert code here }
end.


0 komentar:

Posting Komentar