Data types

Data types

INTEGER is one of five intrinsic data types. The others are

REAL

COMPLEX

LOGICAL

CHARACTER

The programmer can define additional (derived) data types.

i and j are examples of variables. A variable is a name that is used to identify stored data. The data type for the variable (INTEGER in this case) specifies the kind of data that is stored. INTEGERs are used to represent whole numbers that may be signed but which do not have a fractional part. INTEGERs are often used for counting purposes. They have the advantage that they are stored exactly without round-off error.

This is an example of a declaration. Declarations belong to the set of statements called specification statements that must come before any executable statements in the program.

 

 

Basket
Empty
 
Copyright © 1999-2024 Silverfrost Limited