hello guys! pls how can i connect a source code to a file? have this source code below but cannot connect to the file even when i have it locally. thanks
! a dummy program implicit none real:: sum, avg, score1, score2, score3 integer:: counter open(unit=5, file='in_scr.txt', status='old') open(unit=6, file='out_scr.txt', status='new') do 10 counter=1,3 sum=0.0 read(5,20)score1, score2, score3 sum=score1+score2+score3 avg=sum/3 write(6,30)counter, score1, score2, score3 write(6,40)sum, avg 10 continue stop 20 format(3(f5.2, 2x)) 30 format(//, 'student', i2,/, 'score1', 2x, f5.2,/, 'score2', 2x, f5.2,/, 'score3', 2x, f5.2) 40 format(/, 'total and average =', 2x, 2(f6.2, 2x), 'respectively', //)
end