Simple Addition

Programming

This program demonstrates basic variable declaration, assignment, and arithmetic operations in Fortran.

Key Concepts

Implementation

program simple_addition
    implicit none
    integer :: a, b, sum

    a = 5
    b = 10
    sum = a + b

    print *, "The sum of ", a, " and ", b, " is ", sum
end program simple_addition

Output

The sum of            5  and           10  is           15