QP School

Full Version: User-defined functions in Object Pascal
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
function Multiply(x, y: Double): Double;
begin
  Result := x * y;
end;

begin
  // Variable declaration
  var
    result: Double;
    a: Double := 2.5;
    b: Double := 3.7;

  result := Multiply(a, b);

  WriteLn('Result of multiplication:', result:0:2);
end.