Skip to content

Instantly share code, notes, and snippets.

@natebenes
Created March 28, 2010 00:39
Show Gist options
  • Save natebenes/346459 to your computer and use it in GitHub Desktop.
Save natebenes/346459 to your computer and use it in GitHub Desktop.
program Q2
integer I, N, Sum
data I, N, Sum, Result / 0, 0, 0, 0 /
print *, 'Enter a positive integer'
read *, N
print *, ' i Sum'
print *, '----------------'
do 100 , I = 1, N, 1
Sum = Sum + I + ( N - I + 1)
print *, I, Sum
100 continue
Result = Sum /2
print *, ' '
print *, 'The result: ', Result
stop
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment