Compiler Explorer - Fortran (x86-64 gfortran 8.2)
! Type your code here, or load an example. pure function nth(v, n) result(out) implicit none integer, intent(in) :: v(3) integer, value, intent(in) :: n integer :: out out = v(n) return end function nth