program one_to_n integer sum, i, n write(*,*) 'Please tell me the number N:' read(*,*) n sum = 0 do i=1,n sum = sum + i end do write(*,*) 'The answer for 1 + 2 + 3 + ... + N is :', sum end