integer :: i,j integer, parameter :: n=10000 real :: A(n,n), B(n,n), C(n,n) do i = 1,n do j = 1,n C(i,j) = i*j B(i,j) = j ! all j columns of the ith row enddo enddo do i = 1,n do j = 1,n A(i,j) = B(i,j) + C(i,j) ! all j columns of the ith row enddo enddo end