Created
March 9, 2010 22:58
-
-
Save natebenes/327256 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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