Advertisement
Guest User

Untitled

a guest
Jan 7th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. program random_matrix
  2. implicit none
  3.  
  4.  
  5. real, allocatable:: A(:,:)          ! matrix for which the determinant is calculated
  6. integer             n               ! size of the matrix A nxn
  7. integer             i,j             ! loop indexes
  8. real                r(1)            ! random number
  9.  
  10. ! Typing in the size of the matrix and amount of 0
  11. !**************************************************************************!
  12. write(*,*)  'amount of rows and colums'
  13. read(*,*)   n
  14. allocate (A(n,n))
  15.  
  16. ! Creating the matrix of random numbers
  17. !**************************************************************************!
  18.  
  19. do i=1,n
  20.     do j=1,n
  21.     A(i,j)=floor(rand(r)*10.0)+1)
  22.     enddo  
  23. enddo
  24. write (*,*) A(i,j)
  25.  
  26.  
  27. end program
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement