PROGRAM Sum_of_Integers
!-----------------------------------------------------------------------
! Program to compute the sum of the first Number integers.
! Variables used are:
!   Number : the last integer
!   Sum    : the sum  1 + 2 + . . . + Number
!   I      : DO loop control variable
!
! Input:  Number
! Output: Number and Sum
!-----------------------------------------------------------------------

  IMPLICIT NONE
  INTEGER :: Number, I, Sum = 0

  PRINT *, "This program computes the sum 1 + 2 + ... + Number."
  PRINT *, "Enter Number:"
  READ *, Number

  DO I = 1, Number
     Sum = Sum + I
  END DO

  PRINT *, "1 + 2 + ... +", Number, "=", Sum
  STOP
END PROGRAM Sum_of_Integers
