| Hello World in Fortran |
|
| programming |
This article describes how to write, compile and execute a "Hello World" program in Fortran on Linux (RedHat / Centos / Fedora).
1. the prerequisites
If it is not installed yet, you can install it with yum (you need to be root to do that):
2. write the code
now write the following code into the sourcefile: Please note: there are 6 spaces at the beginning of each line!
explanationThe name of our program is "helloworld". This is not required, but is recommended.
The command "print *" prints items to the screen.
marks the end of the program "helloworld".
3. compile the codeThis produces an executable called "helloworld". 4. run the programyou can now execute the binary program with:
Comments (0)
Powered by !JoomlaComment 4.0 beta1
!joomlacomment 4.0 Copyright (C) 2009 Compojoom.com . All rights reserved." |


