Basics
Arithmetic
Division, Modulo, Power
Integer division truncates toward zero, mod returns the remainder, and ** raises to a power.
Program
Play the program to compute a quotient, remainder, and square.
arithmetic.f90
program arithmetic
implicit none
integer :: a, b, q, r, p
a = 7
b = 2
q = a / b
r = mod(a, b)
p = a ** b
print '(I0, A, I0, A, I0)', q, " ", r, " ", p
end program arithmetic
integer division
`7 / 2` truncates to `3`.
mod
`mod(7, 2)` returns the remainder `1`.
exponent
`a ** b` raises `a` to the power `b`.