program maxmin implicit none real max, min, temp integer i, num_total character*40 file_name write(*,*) 'Name of file to read in (note that first line should', &' be an integer describing the total number of numerical data) :' read(*,*) file_name open(unit=10,file=file_name,status='OLD') read(10,*) num_total c Read in first data and set initial Min and Max value. read(10,*) temp max = temp min = temp do i=1, num_total - 1 read(10,*) temp if (temp.gt.max) max = temp if (temp.lt.min) min = temp end do close(10) write(*,*) 'The maximum value of the data set is :', max write(*,*) 'The minimum value of the data set is :', min end