Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
User-defined functions in Object Pascal
#1
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.
Also follow me on Youtube for videos about video games:
https://www.youtube.com/channel/UCxfkGVU...2mQ/videos
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Getting started with Object Pascal Qomplainerz 0 212 07-25-2023, 09:45 AM
Last Post: Qomplainerz
  Basic algorithms and Data Structures in Object Pascal Qomplainerz 0 234 07-25-2023, 09:44 AM
Last Post: Qomplainerz
  File I/O in Object Pascal Qomplainerz 0 208 07-25-2023, 09:44 AM
Last Post: Qomplainerz
  Exception handling in Object Pascal Qomplainerz 0 258 07-25-2023, 09:43 AM
Last Post: Qomplainerz
  Object-oriented concepts in Object Pascal Qomplainerz 0 228 07-25-2023, 09:43 AM
Last Post: Qomplainerz
  String manipulation in Object pascal Qomplainerz 0 205 07-25-2023, 09:41 AM
Last Post: Qomplainerz
  Arrays and Collections in Object Pascal Qomplainerz 0 234 07-25-2023, 09:41 AM
Last Post: Qomplainerz
  Control flow in Object Pascal Qomplainerz 0 230 07-25-2023, 09:40 AM
Last Post: Qomplainerz
  Basic Input and Output in Object Pascal Qomplainerz 0 231 07-25-2023, 09:39 AM
Last Post: Qomplainerz
  Datatypes and Variables in Object Pascal Qomplainerz 0 202 07-25-2023, 09:39 AM
Last Post: Qomplainerz

Forum Jump:


Users browsing this thread: 1 Guest(s)