PROGRAM SomPro INTEGER :: ris, a, b, c INTERFACE INTEGER FUNCTION somma(input1,input2) integer , intent(IN) :: input1,input2 END FUNCTION somma INTEGER FUNCTION prodotto(input1,input2) integer , intent(IN) :: input1,input2 END FUNCTION prodotto END INTERFACE WRITE(*,*) "Dammi i tre numeri interi operandi" READ(*,*) a, b, c CALL scrivi(somma,ris) WRITE(*,*) "Il risultato e' ", ris CALL scrivi(prodotto,ris) WRITE(*,*) "Il risultato e' ", ris STOP CONTAINS SUBROUTINE scrivi(operaz, risext) integer, external :: operaz integer, intent(OUT) :: risext risext = operaz(operaz(a,b),c) END SUBROUTINE scrivi END PROGRAM SomPro INTEGER FUNCTION somma(input1, input2) integer , intent(IN) :: input1, input2 somma = input1 + input2 write(*,*) "somma parziale = ",somma END FUNCTION somma INTEGER FUNCTION prodotto(input1, input2) integer , intent(IN) :: input1, input2 prodotto = input1 * input2 write(*,*) "prodotto parziale = ",prodotto END FUNCTION prodotto