-
-
Save rightfold/939bbd9e56f082b7882b 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 pic 9(10). | |
01 i pic 9(10). | |
01 total pic 9(10). | |
procedure division. | |
display "Enter a positive integer" | |
accept n | |
perform varying i from 1 by 1 until i > n | |
add i to total | |
end-perform | |
display "The sum is " total | |
. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment