| Basic of Fortran Language |
| |
| Fortran Variables |
| |
| A quantity which may vary during program execution is called a variable.
Variables names are name tags of memory location where numbers
are stored. A number stored in a memory location with an integer
variable name is an integer and one stored in a location with
a real variable name may have a fractional part. A variable must
have a name. One variable name may consists maximum of up to six
characters. First character of a variable must be an alphabet.
Special characters like &, #, $, etc are not allowed in variable
name. Blank spaces in a name are ignored. |
| Example: |
THETA
MATRIX
HEIGHT |
| From this example it should be clear that the value of THETA,
MATRIX and HEIGHT may vary according to the program. |
| Following Points should keep in mind while declaring Variable: |
| · A variable must have a name. |
| · One variable name may consists maximum of up to six characters. |
| · First character of a variable must be a letter. |
| · Special characters like &, #, $, etc are not allowed in
variable name. |
| · Blank spaces not allowed in variable name. |
| Variables can be easily understand by this table: |
| Wrong |
Right |
Description |
| 2THETA |
THETA |
First character should be an alphabet |
| &MATRIX |
MATRIX |
Special characters & are not allowed |
| INT R |
INTR |
Blank spaces in a name are ignored |
|
| |
| |
|
| |
| |