Last active
November 5, 2022 01:19
-
-
Save zrhans/e53a9da55b0ec556978fefa43d68e70d 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 mainprog | |
implicit none | |
real :: a, b | |
a = 2.0 | |
b = 3.0 | |
Print *, "Antes de chamar troca" | |
Print *, "a = ", a | |
Print *, "b = ", b | |
call troca(a, b) | |
Print *, "Depois de chamar troca" | |
Print *, "a = ", a | |
Print *, "b = ", b | |
contains | |
subroutine troca(x, y) | |
real :: x, y, temp | |
temp = x | |
x = y | |
y = temp | |
end subroutine troca | |
end program mainprog |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment