fork download
  1. program loop
  2. integer row, col
  3. integer mat(2,2)
  4. integer sum
  5. mat (1, 1) = 1
  6. mat (1, 2) = 2
  7. mat (2, 1) = 0
  8. mat (2, 2) = 4
  9. sum = 0
  10. Do row = 1, 2, 1
  11. Do col = 1, 2, 1
  12. if (mat(row, col) == 0) exit
  13. sum = sum + mat(row, col)
  14. End Do
  15. End Do
  16.  
  17. print *, sum
  18.  
  19. end program loop
Success #stdin #stdout 0.01s 2620KB
stdin
Standard input is empty
stdout
           3