PROGRAM TO FIND THE SUM OF THE SERIES 1 + 1/4 + 1/9 ...
Identification Division. Program-Id. Sum-Series-6. Environment Division. Data Division. Working-Storage Section. 77 N Pic 999. 77 Counter Pic 999. 77 Tempsum Pic 99v9999 Value 0. * The Designing of the Main Screen of the Program. Screen Section. * The Input Screen. 01 Main-Screen. 02 Line 3 Column 25 " The Series to be Calculated is : " Reverse-Video Blink. 02 Line 5 Column 28 "1 + 1/4 + 1/9 + 1/16 ..." Highlight. 02 Line 7 Column 15 "Enter the No. of terms for the above seri - "es : ". 02 Line 7 Column 60 Pic 999 To N Highlight. * The Output Screen. 01 Display-Screen. 02 Line 10 Column 10 "The Sum of the above Series for term "s is : ". 02 Line 10 Column 42 Pic zz9 From N Highlight. 02 Line 10 Column 58 Pic zz.9999 From Tempsum Highlight. Procedure Division. * The Initialize-Para. Main-Para. Display Main-Screen. Accept Main-Screen. Perform Series-Loop Varying Counter From 1 By 1 Until ( Counter > N). Display Display-Screen. Stop Run. * The Paragraph to Calculate the Sum. Series-Loop. Compute Tempsum = Tempsum + (1 / (Counter * Counter) ).