Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
IDENTIFICATION DIVISION.
PROGRAM-ID. SumOfInteger.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 i BINARY-LONG.
01 n BINARY-LONG.
01 s BINARY-LONG VALUE 0.
PROCEDURE DIVISION.
DISPLAY "ENTER A NUMBER"
ACCEPT n
PERFORM VARYING i FROM 1 BY 1 UNTIL i < n
ADD i TO s
END-PERFORM
DISPLAY "the sum is " s.
STOP RUN.
Advertisements
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.
AcceptLearn more