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
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

Plus Sign - edit characters for numeric data: + (Plus Sign) : A plus sign is alike to minus sign except that when the item is positive, +sign will be inserted rather th

Illustration of Divide verb: (a) DIVIDE 5 INTO A. If the value of A is 20, then after execution of this statement the value of A will be 4. The older value of A will be los

File- Section &Working-Storage Section: a) FILE SECTION: The FILE SECTION includes the explanation of all data items that must be read from or written onto some external

Example of Move corresponding: Consider the DATA DIVISION entries shown below. Suppose it is needed that the data stored in the 4 fields of the PAY_REC should be

PROGRAM TO DEMONSTRATE MERGE VERB: The two files for which a record having 2 fields viz. Account Number and Name are already available. Now Merge these two files and create a

PROGRAM FOR ADD CORRESPONDING: We have to write a simple program to demonstrate Add Corresponding.   identification division.   program- id.   environment division.

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

ADD VERB: The ADD Verb can be used to find the sum of two or more numbers and to store the sum.  The ADD verb takes any one of the two forms as shown below:

RELATIVE FILES: The Files that are stored on a direct access storage medium like magnetic disk are frequently known as direct access files. The COBOL supports three different