The next simplest Fortran program is referred to by programmers as the "Hello World" program. This is the simplest program that actually produces some output. An implementation of the "Hello World" program in Fortran is:
PROGRAM MAIN PRINT *, 'HELLO WORLD' STOP END
The PRINT statment writes output to the screen when the program is run interactively. (In fact it writes to something called "standard output," which defaults to the screen.) The asterisk in the PRINT statment refers to "free format" output. This essentially means that we aren't interested in the exact format in which the system prints the result.
Assignment:
(1) Type the "Hello World" program. Compile it and run it.
(2) Change the "Hello World" program to print out something else, such as your name.
Back to main page for programming tutorial