Skip to content

Instantly share code, notes, and snippets.

@prefork
Created March 9, 2010 22:58
Show Gist options
  • Save prefork/327256 to your computer and use it in GitHub Desktop.
Save prefork/327256 to your computer and use it in GitHub Desktop.
PROGRAM example4
IMPLICIT NONE
INTEGER :: input
INTEGER :: mod_out
! start program
DO
WRITE(*,*) "Please enter an integer"
READ(*,*) input
IF(input == 0) EXIT
mod_out = modulo(input,2)
IF (mod_out == 0) THEN ! If evenly divisible
WRITE(*,*) input,"is an even number"
ELSE
WRITE(*,*) input,"is an odd number"
ENDIF
END DO
WRITE(*,*) 'Goodbye'
END PROGRAM example4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment