fork download
  1. program sum_range
  2. implicit none
  3. integer :: i, total_sum
  4.  
  5. total_sum = 0
  6. do i = 1, 100
  7. total_sum = total_sum + i
  8. end do
  9.  
  10. print *, "Sum of 1 to 100 is: ", total_sum
  11. end program sum_range
Success #stdin #stdout 0.01s 5320KB
stdin
Standard input is empty
stdout
 Sum of 1 to 100 is:         5050