Program for compute verb, COBOL Programming

PROGRAM FOR COMPUTE VERB:

We have to write an easy program to elaborate the COMPUTE verb. 

Identification division.

Program- id. compverb.

Environment division.

Data division.

Working-storage section.

77  a  pic s9(3)v9(2) value 0.

77  b  pic s9(3)v9(2) value 0.

77  c  pic s9(4)v9(2) value 0.

7  e-c pic  +z(4).z(2).

Procedure division.

Para-1.

Display(1 1) erase.

   Display(3 5) "Enter first number :".

  Accept a.

  Display(5 5) "Enter second number :".

  Accept b.

            Compute c= a+b.

       Move c to e-c.

          Display(15 5) "Answer = " e-c.

  Stop run.

Posted Date: 10/17/2012 1:31:41 AM | Location : United States







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

Write discussion on Program for compute verb
Your posts are moderated
Related Questions
CONDITIONS-NAME CONDITION:   The condition name is an entity which itself is a condition and these can have either a true or false value. Though, a condition name cannot be d

Illustration of Subtract verb: (a) SUBTRACT A FROM B. This illustration means that the value of A will be subtracted from the value of B and the subtracted result will be s

There are some restrictions when these procedures are used. (i) The Procedure should not contain any SORT/MERGE statement. (ii) An explicit transfer of the control outside

Program for Sequential File Creation & Rewriting  We have to write a program to create a Length file with just two fields: l (Length) and l-c (Length-Code). Add a few records.

Concept of a two-dimensional table: Concept of a two-dimensional table can be easily extended to tables having three or more dimensions. The Handling of tables up to three dim

WRITE STATEMENT: The records are written to be logical place as determined from the value of the record key. The INVALID KEY condition occurs in the cases shown below: (i)

Group Item as Operand in the Relational Condition: Whenever an operand of a relational condition is the group item, the item is then considered to be an alphanumeric field. Th

RULES OF RENAMES CLAUSE:   The rules below should be observed while using the RENAMES clause: (i) All RENAMES entries should be written only after the last record descript

PROGRAM FOR SIMPLE PERFORM: We have to write a program to elaborate simple PERFORM statement Identification division. Program- id.  Perf1. Environment division. Da

PERFORM WITH VARYING OPTION: The format is as shown below: