program hello real, dimension(20) :: x real, dimension(20) :: y integer :: i x = [0.2481, 0.4133, 0.4961, 0.4618, 0.3686, & -0.0495, -0.3477, -0.4219, -0.4954, & -0.4156, -0.4162, 0.3258, -0.0574, 0.2749, & -0.1003, -0.2711 , 0.0383 , -0.3934, 0.3173, -0.2402] y=x do i= 2,20,1 y(i)= x(i) + y(i-1) end do print *, y(1), y(2), y(3), y(4), y(5) print *, y(6), y(7), y(8), y(9), y(10) print *, y(11), y(12), y(13), y(14), y(15) print *, y(16), y(17), y(18), y(19), y(20) end program Hello
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy. Accept Learn more