Hello World2407
Hello World2407
A “Hello World” program is a computer program that prints to the screen the words “hello world”. It is
the simplest example of a program one can write and is often used to introduce students to a programming
language.
4. Compiling
For this class we will use the gfortran compiler. Recall that a compiler is a computer program that translates
your source code in the fortran language to assembly or machine language for the purpose of making an
executable file. To compile your program use the command
gfortran hello world.f90
Note that this must be the name of the file you opened in #2. This will produce an executable that is called
“a.out”. After you have done this, if you type the UNIX command ls it will list the files you have in the
directory Introduction – you should have your source code and the a.out file.
5. Executing
To execute the executable a.out file type
./a.out
If you did everything carefully, then it should print Hello World! to the screen.