Exercise 1: Modifying state with a subroutine
To modify an input argument in-place, define it with the intent(in out) attribute, as shown in the following listing. Listing 3.21 A subroutine that modifies an input argument in-place ❶ Uses intent(in out) to indicate that a is both an input and an output ❷ We can modify a directly; it will be returned to the calling program or procedure. You […]