QP School

Full Version: Datatypes and Variables in Object Pascal
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
program DataTypesExample;
begin
  // Variable declaration
  var
    num1: Integer;
    num2: Double;
    name: String;

  num1 := 42;
  num2 := 3.14;
  name := 'John Doe';

  // Output to screen
  WriteLn('Integer:', num1);
  WriteLn('Double:', num2:0:2);
  WriteLn('String:', name);
end.