Fortran · 310 bytes Raw Blame History
1 ! CHECK: 30
2 program test_sub
3 implicit none
4 integer :: a, b, c
5 a = 10
6 b = 20
7 call add_nums(a, b, c)
8 print *, c
9 contains
10 subroutine add_nums(x, y, result)
11 integer, intent(in) :: x, y
12 integer, intent(out) :: result
13 result = x + y
14 end subroutine
15 end program
16