program transpose
integer::i,j,a(10,10),m,n,b(10,10)
print*,"Enter the order of the matrix:"
read(*,*)m,n
print*,'Enter the matrix:'
do i=1,m
read*,(a(i,j),j=1,n)
enddo
print*,"The entered matrix is:"
do i=1,m
print*,(a(i,j),j=1,n)
enddo
!to determine transpose of entered matrix
do i=1,m
do j=1,n
b(j,i)=a(i,j)
enddo
enddo
print*,"The transpose of the entered matrix is:"
do i=1,n
print*,(b(i,j),j=1,m)
enddo
end program
integer::i,j,a(10,10),m,n,b(10,10)
print*,"Enter the order of the matrix:"
read(*,*)m,n
print*,'Enter the matrix:'
do i=1,m
read*,(a(i,j),j=1,n)
enddo
print*,"The entered matrix is:"
do i=1,m
print*,(a(i,j),j=1,n)
enddo
!to determine transpose of entered matrix
do i=1,m
do j=1,n
b(j,i)=a(i,j)
enddo
enddo
print*,"The transpose of the entered matrix is:"
do i=1,n
print*,(b(i,j),j=1,m)
enddo
end program
Comments
Post a Comment