! This is a basic starting shell for your programs MODULE const INTEGER, PARAMETER :: dp = KIND(1.0d0), sp = KIND(1.0e0) REAL(KIND=dp), PARAMETER :: dpi = 3.141592653589793d0 END MODULE const ! PROGRAM prog USE const IMPLICIT NONE ! Variable declarations go here INTEGER :: rvalue, total total = 0 DO WRITE(*,*) 'Input next integer' READ(*,*) rvalue IF( rvalue < 0) THEN EXIT ENDIF total = total + rvalue ENDDO WRITE(*,*) 'Final total = ',total END PROGRAM prog !!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! Input next integer ! 1 ! Input next integer ! 2 ! Input next integer ! 3 ! Input next integer ! 4 ! Input next integer ! 5 ! Input next integer ! -6 ! Final total = 15