program Calculates_N implicit none integer :: a , sum_N , N write(*,*) " Calculate 1 + 2 + ... + N " write(*,*) " Please input is bigger than zero the integer N " a=1 sum_N=0 read (*,*) N do a=1 , N sum_N=sum_N+a end do write(*,*)"The answer of 1 + 2 + ... + " , N , " is" , sum_N stop end program Calculates_N