program read_write_to_file_2 write(*,*)'How many numbers to save?' read(*,*) n write(*,*)'Type in',n,'numbers now:' open(unit=10,file='your_data_2') write(10,*)n do i=1,n read(*,*) a write(10,*) a enddo close(10) write(*,*)'Now your data saved in "your_data_2".' write(*,*)'The first value is the number',n end