FoRtRaN
Wednesday, November 24, 2010
write a program to sum the main diagonal of a matrices (find the trace of a matrices)
implicit double precision (a-h,o-z)
dimension A(3,3)
DATA A/1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0/
C=0
do i=1,3
j=i
C=C+A(i,j)
enddo
write(*,*)C
stop
end
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment