PROGRAM FOR PERFORM ...UNTIL
We have to write a program to find the sum of "n" natural numbers.
Identification division.
Program- id. PerfUntil.
Environment division.
Data division.
Working-storage section.
01 n pic 9(2) value 0.
01 i pic 9(2) value 1.
01 sum pic 9(4) value 0.
Procedure division.
Para-1.
Display(1 1) erase.
Display(5 5) "Enter a Number ".
Accept n.
Perform calc-para until i > n.
Display(10 5) " Sum = " sum.
Stop run.
Calc-para.
Compute sum = sum + i.
Add 1 to i.