Created
March 10, 2010 21:06
-
-
Save natebenes/328399 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PROGRAM sumIntegers | |
IMPLICIT NONE | |
! Programmer: Nate Benes | |
! Purpose: Sums the integers from 1 to 100 | |
INTEGER :: i ! For the DO Loop | |
INTEGER :: total ! To keep a running total | |
! Initialize our counter | |
total = 0 | |
! I can set this up a few different ways, | |
! but this is the simplest | |
! Loop from 1 to 100 and count by 1's | |
DO i=1,100,1 | |
total = total + i | |
END DO | |
WRITE(*,*) total ! Display the output to the screen | |
END PROGRAM |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment