0% found this document useful (0 votes)
20 views2 pages

'Input The Number of Matrix A': Dimension Write Do Do Write Write Read Enddo Enddo

This document contains a Fortran program for multiplying two matrices. It defines three matrices: A, B, and C. It reads in values for matrices A and B from user input. It then performs the multiplication operation to calculate each element of matrix C based on the elements of A and B. Finally, it outputs the results of matrix C.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views2 pages

'Input The Number of Matrix A': Dimension Write Do Do Write Write Read Enddo Enddo

This document contains a Fortran program for multiplying two matrices. It defines three matrices: A, B, and C. It reads in values for matrices A and B from user input. It then performs the multiplication operation to calculate each element of matrix C based on the elements of A and B. Finally, it outputs the results of matrix C.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

E:\Mangoes Doc\College\S2\3rd Semester\Komputasi\plato\Perkalian Matriks.

for
c Matrix Program
dimension a(10,10), b(10,10), c(10,10)
c Reading input data of matrix A
write(*,*)'Input the number of Matrix A'
do i=1,2
do j=1,3
write(*,*)'i =',i
write(*,*)'j =',j
read(*,*)a(i,j)
enddo
enddo

c writing output of Matrix A


do i=1,2
do j=1,3
write(*,*)'i =',i
write(*,*)'j =',j
write(*,*)a(i,j)
enddo
enddo

c Reading input data of Matrix B


write(*,*)'Input the number of Matrix B'
do i=1,3
do j=1,2
write(*,*)'i =',i
write(*,*)'j =',j
read(*,*)b(i,j)
enddo
enddo

c writing output of Matrix B


do i=1,3
do j=1,2
write(*,*)'i =',i
write(*,*)'j =',j
write(*,*)b(i,j)
enddo
enddo

c The Operation
do i=1,2
do j=1,2
c(i,j)= 0
enddo
enddo

do i=1,2
do j=1,2
do k=1,3
c(i,j)=c(i,j)+(a(i,k)*b(k,j))
enddo
enddo
enddo

c writing output of Matrix B


write(*,*)'Matrix C are'
do i=1,2
do j=1,2
write(*,*)'i =',i
write(*,*)'j =',j

Page 1
E:\Mangoes Doc\College\S2\3rd Semester\Komputasi\plato\Perkalian Matriks.for
write(*,*)c(i,j)
enddo
enddo

stop
end

Page 2

You might also like