GAUSS

 !program name: GAUSS

!Gauss elimination a matrix of order n

!Input dimension of the matrix and its elements

!This program does one Gauss operation: swapping two rows

  Integer :: n,i,j

  Integer, dimension(:,:), allocatable :: A,elem

  Print *, 'Enter the dimension, n, of the square matrix A: '

  Read *, n

  Allocate ( A(n,n) )

  Allocate ( elem(n,n) )

  Do i=1,n

     Do j=1,n

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

     Read *, A(i,j)

     End do

  End do

  Do i=1,n

     Do j=1,n

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

     End do

  End do

 ! sawpping first and second rows

  Do j=1,n

      elem(2,j)=A(1,j)

      elem(1,j)=A(2,j)

  end do

  do i=3,n

      do j=1,n

        elem(i,j)=A(i,j)

      end do

  end do

   Print *, 'The matrix, B, after one Gauss operation is: '

   Do i=1,n

     Do j=1,n

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

     End do

   end do

   Deallocate (A)

   Deallocate (elem)

stop

end

Comentários

  1. Casino site reviews and ratings - Lucky Club
    Casino site reviews and ratings. Play at Casino with best bonuses. Find out about the site, mobile version and payment methods. 777 Casino. Rating: 3 · luckyclub.live ‎Review by Lucky Club

    ResponderExcluir

Postar um comentário

Postagens mais visitadas deste blog

HYDROGEN-RADIAL

HYDROGEN-POTENTIAL

ONE_PART_QHO