Hello, World
Here is a simple "Hello World" program in Pascal:
program HelloWorld;
begin
WriteLn('Hello, World!');
end.
Steps to Run
Save the code: Save the above code in a file named
hello.pas
.Open a terminal: Navigate to the directory where
hello.pas
is saved.Compile the program: Use the Pascal compiler (e.g., Free Pascal or Turbo Pascal) to compile the program. Run the following command:
fpc hello.pasRun the program: After compilation, execute the generated binary file (e.g.,
hello
orhello.exe
depending on your platform). Run the following command:./hello
This will output:
Hello, World!
Last modified: 01 January 2025