Program for compute verb, COBOL Programming


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.


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
Illustration of Multiply verb: (a)  MULTIPLY A BY B. In this situation the value of A & B will be multiplied and the product will be stored in B.  The decimal point locatio

PROGRAM FOR SUBTRACT VERB: We have to write a simple program to elaborate the SUBTRACT verb. You can also use edit characters in the program. Identification division. Pr

Format for COBOL Programs: The COBOL is a high-level language. Therefore, a COBOL program can be executed on a computer for which a COBOL compiler exists. The compiler transla

REWRITE statement: The REWRITE statement is used to update the existing record in a disk file. The normal format is as shown below: REWRIE  record-name  [  FROM      ide

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

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:

MULTIPLY VERB:   The Multiply Verb causes one or more multiplicands to be multiplied by the multiplier and to store the products. The form of the MULTIPLY verb is as shown be

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

77 level used for- It is Elementary level item. it Cannot be subdivisions of other items or cannot be qualified, or they can be subdivided themselves.

ARITHMETIC VERBS: Most of the problems need some computations to be performed on the input or intermediate data that are numeric in nature. The Arithmetic verbs are used to pe