program save_data real x(2001), y(2001) dx = (6*2*3.1415 - 0)/2000 do i=1,2001 x(i)=(i-1)*dx y(i)=sin( x(i) ) end do open(unit=15,file='sin.dat') write(15,*)2001 do i=1,2001 write(15,*) x(i), y(i) end do close(15) write(*,*)'The file sin.dat has been wriiten.' end