MULT2

 !name of the program:MULT2

! matrix multiplication AxB=C

integer , allocatable :: A(:,:), B(:,:), C(:,:)

integer :: m, n, o, i, j

 

Print *, "Enter the dimensions of matrix A(m,n)"

Read *, m, n

allocate(A(n,m))

 

Print *, "Enter the dimension o of matrix B(n,o)"

Read *, o

allocate(B(n,o))

 

allocate(C(m,o))

 

Do i=1,m

   Do j=1,n

     Print *, 'A(',i,',',j,')= '

     Read *, A(i,j)

   End do

end do

do i=1,m

     write (*,*) (A(i,j),j=1,n)

end do

print *,

 

Do i=1,n

   Do j=1,o

     Print *, 'B(',i,',',j,')= '

     Read *, B(i,j)

   End do

end do

do i=1,n

     write (*,*) (B(i,j),j=1,o)

end do

print *,

 

  C=matmul(A,B)

 

do i=1,m

     write (*,*) (C(i,j),j=1,o)

end do

print *,

 

  stop

  end

Comentários

Postagens mais visitadas deste blog

HYDROGEN-RADIAL

HYDROGEN-POTENTIAL

ONE_PART_QHO