c This program finds the sum of the squares of the first 100 integers c You should declare the type of EVERY variable you use PROGRAM SumOfSquares INTEGER:: i ! i is an integer variable ! the double colon syntax is from f90, but g77 understands it REAL:: sum ! sum is a single precision floating point variable sum=0 ! initisalise sum DO i=1,100 ! this runs i over the first 100 integers sum=sum+i**2 ! this increments the sum. Indent inside control loops for clarity of code END DO ! DO ... END DO is a fortran 90 construct that g77 understands WRITE(UNIT=*,FMT=*) " The total is = ", sum END PROGRAM SumOfSquares