Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dimension SALES(6,10)
- c ! filling the sales array using read method
- do 10 i=1,6
- read(*,*) (SALES(i,j),j=1,10)
- 10 continue
- c ! here we will sum every row only and print each row result
- do 20 i=1,6
- WSTORE = 0
- do 25 j=1,10
- WSTORE = WSTORE + SALES(i,j)
- 25 continue
- write(*,*) WSTORE
- 20 continue
- c ! here we will sum each column result (we replaced i,j to j,i)
- do 30 i=1,6
- DEPART = 0
- do 35 j=1,10
- DEPART = DEPART + SALES(j,i)
- 35 continue
- write(*,*) DEPART
- 30 continue
- c ! here we will sum (all the array)(we removed DEPART=0)
- do 40 i=1,6
- do 45 j=1,10
- SUM = SUM + SALES(i,j)
- 45 continue
- 40 continue
- write(*,*)SUM
- PAUSE
- STOP
- END
Advertisement
Add Comment
Please, Sign In to add comment