Chapter 2 - Data Types and Operations

Chapter 2 - Data Types and Operations

One of the important elements of a computer program is the type of data to be processed. The four basic types of REAL, INTEGER, CHARACTER, and LOGICAL are introduced. This is done for both data constants and for variables used in the course of a program. The declaration statements are defined, as are the rules of implicit variable types for undeclared variables.

The main calculation statement - the assignment statement - is covered next, along with rules for integer division and variable type conversion. The last two items can lead to "strange" results if the rules are not understood, and mixed data type arithmetic is done.

The chapter includes several programs to show these details. The other new FORTRAN statements introduced are the READ statement and the DO/END DO, for repeating a section of code, to allow a large amount of data to be processed.

Have a look at the sample programs for this chapter

Come back to the main page