Function

Blok pada function hampir sama dengan blok pada procedure, hanya pada function harus dideklarasikan dengan tipe dari function tersebut yang merupakan tipe hasil dari function itu sendiri. Sehingga dikatakan function dapat mengembalikan nilai.

Sintaks :

FUNCTION identifier(daftar parameter) : type;

Template Soal :

program program_pascal;
uses crt;

function kosong(param) : integer;
    begin
    end;

begin

end.

Last updated

Was this helpful?