Skip to content

Instantly share code, notes, and snippets.

@vendethiel
Created May 26, 2015 10:26
Show Gist options
  • Save vendethiel/c9f6fdb7f2d0a4a69da0 to your computer and use it in GitHub Desktop.
Save vendethiel/c9f6fdb7f2d0a4a69da0 to your computer and use it in GitHub Desktop.
identification division.
program-id. sumofintegers.
data division.
working-storage section.
01 n binary-int.
01 i binary-int.
01 sum binary-int.
procedure division.
display "Enter a positive integer"
accept n
perform varying i from 1 by 1 until i>n
add i to sum
end-perform
display “The sum is “ sum.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment