Variable (integer / real)
Typed variable declaration.
Syntax
integer :: name real :: name
Description
Variables are declared at the beginning of the program, BEFORE executable lines. integer is whole number, real is decimal, character is text. implicit none is a good habit.
Example
Loading editor…
Expected output
36 1.72
When to use?
Storing all kinds of data.
Common mistakes
- ⚠️ Declarations must be at the beginning of the code; new variables cannot be defined in between.