Click here to load reader
View
11
Download
0
Embed Size (px)
Fortran
i
Fortran
i
About the Tutorial
Fortran was originally developed by a team at IBM in 1957 for scientific
calculations. Later developments made it into a high level programming
language. In this tutorial, we will learn the basic concepts of Fortran and its
programming code.
Audience
This tutorial is designed for the readers who wish to learn the basics of Fortran.
Prerequisites
This tutorial is designed for beginners. A general awareness of computer
programming languages is the only prerequisite to make the most of this
tutorial.
Copyright & Disclaimer
Copyright 2014 by Tutorials Point (I) Pvt. Ltd.
All the content and graphics published in this e-book are the property of Tutorials Point
(I) Pvt. Ltd. The user of this e-book is prohibited to reuse, retain, copy, distribute or
republish any contents or a part of contents of this e-book in any manner without written
consent of the publisher.
We strive to update the contents of our website and tutorials as timely and as precisely
as possible, however, the contents may contain inaccuracies or errors. Tutorials Point (I)
Pvt. Ltd. provides no guarantee regarding the accuracy, timeliness or completeness of
our website or its contents including this tutorial. If you discover any errors on our
website or in this tutorial, please notify us at contact@tutorialspoint.com
mailto:contact@tutorialspoint.com
Fortran
ii
Table of Contents
About the Tutorial ····································································································································i
Audience ··················································································································································i
Prerequisites ············································································································································i
Copyright & Disclaimer ·····························································································································i
Table of Contents ···································································································································· ii
1. OVERVIEW ··························································································································· 1
Facts about Fortran ·································································································································1
2. ENVIRONMENT SETUP ········································································································· 3
Setting up Fortran in Windows ················································································································3
How to Use G95 ······································································································································4
3. BASIC SYNTAX ······················································································································ 5
A Simple Program in Fortran ···················································································································5
Basics ······················································································································································6
Identifier ·················································································································································6
Keywords ················································································································································7
4. DATA TYPES ························································································································· 9
Integer Type ············································································································································9
Real Type ·············································································································································· 10
Complex Type········································································································································ 12
Logical Type ·········································································································································· 12
Character Type ······································································································································ 12
Implicit Typing ······································································································································· 12
5. VARIABLES ························································································································· 13
Variable Declaration······························································································································ 13
Fortran
iii
6. CONSTANTS ······················································································································· 16
Named Constants and Literals ··············································································································· 16
7. OPERATORS ······················································································································· 19
Arithmetic Operators ···························································································································· 19
Relational Operators ··································································