module mod | |
implicit none | |
integer :: variable !<<<<< 3, 14, 8, pass | |
private :: variable | |
contains | |
subroutine setVariable(value) | |
implicit none | |
integer, intent(in) :: value | |
variable = value | |
end subroutine | |
integer function getVariable() | |
implicit none | |
getVariable = variable | |
end function | |
end module | |
program encap1 | |
use mod | |
implicit none | |
call setVariable(3) | |
! 9 + 1 | |
call setVariable(getVariable() *getVariable() + (getVariable() - 2)) | |
print *,getVariable(), " should be equal to ", 10 | |
end program encap1 |