Program for add verb, COBOL Programming

PROGRAM FOR ADD VERB:

We have to write a simple program to elaborate the ADD verb. You can also use edit characters in the program.

Identification division.

Program- id. Addverb.

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.

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

Procedure division.

Para-1.

    Identification division.

    program- id. Add verb.

    environment division.

    data division.

working - storage section.

      77  A  PIC  S9(3)   V9(2)

      77  B  PIC  S9(3)  V9(2)

      77  C  PIC  S9(4)  V9(2)

      77  e-a  PIC  +z(4)  Value 0

PROCEDURE DIVISION

PARA - 1

Description:   This program gets 2 inputs from the user.

                      It adds them by using the ADD verb. 

               c=a+b

The unedited outcome is available in c.

We move c to e-c, where the edit characters are available.

Note that the variable e-c makes the use of the + edit character.

The e-c will always be exhibited with result. 

 

Posted Date: 10/17/2012 1:27:44 AM | Location : United States







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

Write discussion on Program for add verb
Your posts are moderated
Related Questions
Rules for constructing an Arithmetic Expression: The rules for constructing an arithmetic expression are as shown below: (i) When an arithmetic expression specifies a calcu

Example of add verb: (a) ADD A TO B. This illustration represents that the value of A will be added to the value of B and the result will be stored in B.  The alignment of

PROGRAM FOR IF :   We have to write a program to check whether the given number is ODD or EVEN. Identification division. Program- id. Ifst. Environment division.

WRITE Statement:      The WRITE statement for a relative file has the format which is as shown below.          WRITE  record-name   [ FORM   identifier ]

bal majduri ik kanuni apradh hai is de bavjud bache ,ghra,hotla,road, kam karn lai majbur han bacheya te mapeya nu parhai val prerit karn lai ik bashan teyar kro

Direct Organization: Besides the relative or indexed organization, also a direct access file can be designed to have what is termed as direct organization.  In this organizati

Example of Redefines clause: This illustration describes a sales record that may either contain the total amount of sale or the quantity (QTY) and UNIT-PRICE. The aim of such

File Description for the Relative and Indexed Files: The FD entry for a relative or an indexed file is similar to that of a sequential file. Some compilers do not permit varia

FILE CHARACTERISTICS: The task of file handling is the responsibility of the system software termed as IOCS (Input-Output control system). Record Size: We know that th

Illustration of perform statement: PERFORM    CALCUALTE-TAX. In this illustration, the CALCULATE-TAX is either a section name or paragraph name. Assume that it is a section