Created
March 28, 2010 00:41
-
-
Save natebenes/346462 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 Q3 | |
integer I, J, K, Switch | |
! NB removed stray (,) after K in DATA statement | |
data I, J, K / 1, 2, 3/ | |
K = Switch (I, J, K) + Switch (J, K, I) + Switch (K, I, J) | |
print *, I, J, K | |
stop | |
end | |
integer function Switch(X, Y, Z) | |
integer X, Y, Z | |
Z = X**Y | |
Switch = Y**X | |
! NB added this write statement | |
WRITE(*,*) X,Y,Z,Switch | |
return | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment