PROGRAM Exam IMPLICIT NONE CHARACTER(LEN=20) :: name REAL :: mark1, mark2, mark3, mark4 OPEN (UNIT=4,FILE='MARKS.DAT') DO READ(*,*) name, mark1, mark2, mark3, mark4 IF(name == 'END')EXIT WRITE(UNIT=4,FMT=*) name, mark1, mark2, mark3, mark4 WRITE(UNIT=*,FMT=*) name, mark1, mark2, mark3, mark4 END DO CLOSE(UNIT=4) END PROGRAM
Sample data for the above program:
Blair 94. 97. 97. 94. Major 2. 6. 6. 5. Ashdown 49. 28. 77. 66. END 0. 0. 0. 0.