subroutine
output (a,b,s,nsd)
c-------------------------------
dimension
a(nsd), b(nsd), s(nsd)
print *, '
'
print *, ' program results are printed'
print *, ' to an output file named add2.out'
c
c Declare open the
output file
open (unit=2,
file='add2.out', access='sequential',
.action='write', status='replace', form='formatted')
c
c Print
out the results with a description
write(2,15)
nsd
15 format(/
'Student count, nsd='i5)
write(2,25) 'stID','a(i)','b(i)','s(i)'
25
format(/a10, 3a15)
do 10
i=1,nsd
write(2,35)
i,a(i),b(i),s(i)
35
format(i10,3f15.3)
10
continue
return
end