Program for perform - until, COBOL Programming

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.

Posted Date: 10/17/2012 7:45:37 AM | Location : United States







Related Discussions:- Program for perform - until, Assignment Help, Ask Question on Program for perform - until, Get Answer, Expert's Help, Program for perform - until Discussions

Write discussion on Program for perform - until
Your posts are moderated
Related Questions
ADD and SUBTRACT CORRESPONDING: The CORRESPONDING option can also used with the ADD and SUBTRACT verbs. The following are some of the formats of these verbs with the CORRESPON

OCCURS - INDEXED BY PROGRAM: identification division. program- id. searching. environment division. data division. working-storage section. 01 table1.      0

Second form of Divide verb: The second form of this verb is as shown below: In this situation the identifier-1 or numeric- literal-1 will be divided by identifier-2 or

Example of Perform statement: PERFORM BEGIN-CALCULATION THRU END-CALCULATION. Assume, BEGIN-CALCULATION and END-CALCULTION is paragraph names. The execution of the PERFORM

Example of read statement: Illustration: READ OLD-MASTER AT END MOVE ZERO TO END-OF-RECORDS. As a result of this statement, generally the next record from the OLD-MAST

I need help with a COBOL programming assingment. I have started the program but I need help completing the program. I have 5 errors. Here is the question. 10. Suppose your company

PROGRAM TO FIND INTEREST ON BANK DEPOSITS: We have to write a program to find interest on deposits. The criteria is given below : identification division. program-

Data Names and Identifiers:   The Data name provides reference to the storage space in the memory where the real value is stored. This value takes part in the operation whene

Illustration of Renames clause: In the illustration, PAT-OTHER-THAN-BASIC will become a fresh group consisting of DEARNESS-ALLOWANCE, HOUSE-RENT & MTHLY-INCENTIVE. Keep in min

Selection of file Organization: While designing a file, the programmer should select an appropriate association for a file. The order in which the choice is to be made is as s