} - See more at: http://www.seoterpadu.com/2013/06/cara-mengganti-background-blog.html#sthash.hxMWDKOg.dpuf
Home » » Procedure & function (Procedure By Reference)

Procedure & function (Procedure By Reference)

Procedure & function (Procedure By Reference)

Contoh dari Procedure By Reference seperti gambar dibawah ini



Script :

program pf_byReference;
{$APPTYPE CONSOLE}
uses
  SysUtils;
var
    X,Y,Z:integer;
  procedure jumlah(var A,B,C:integer);
    begin
      C:= A+B;
    end;
begin
  writeln;
  writeln('Nama : Maisirotul Rizka');
  writeln('Nim  : 114224022');
  writeln('--------------------------');
  writeln;
  writeln ('=====================================');
  writeln ('CONTOH PENULISAN PROCEDURE & FUNCTION');
  writeln ('    MODEL PROCEDURE BY REFERENCE     ');
  writeln ('=====================================');
  writeln ('');
  write('Masukkan Nilai X = ');readln(X);
  write('Masukkan Nilai Y = ');readln(Y);
  writeln;
  jumlah(X,Y,Z);
  writeln('X + Y = ', Z);
  readln;
  { TODO -oUser -cConsole Main : Insert code here }
end.

Selamat mencoba ^^

0 komentar:

Posting Komentar

 
Support : Your Link | Your Link | Your Link
Copyright © 2013. M Blog - All Rights Reserved
KreasiKu Maisi Published by Maisi
Proudly powered by Blogger