-
-
Save vendethiel/c9f6fdb7f2d0a4a69da0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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