program read_n_find_max character*20 fname write(*,*)'Which file to read data?(20 chr)' read(*,*) fname open(unit=12,file=fname) c open(unit=12,file=fname,status='old') read(12,*)n write(*,*) 'There are',n,'data points in your file.' read(12,*)a a_max = a do i=2,n read(12,*)a if(a > a_max) a_max = a end do c close(12) write(*,*)'The maximum is :',a_max end