Skip to content

Instantly share code, notes, and snippets.

@natebenes
Created March 28, 2010 00:41
Show Gist options
  • Save natebenes/346462 to your computer and use it in GitHub Desktop.
Save natebenes/346462 to your computer and use it in GitHub Desktop.
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