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
Comparison of Nonnumeric Operands: A nonnumeric operand can be compared to the other nonnumeric operand according to the rules as shown below: (i) Fields of Equal Sizes:

SIGN CONDITION:   The sign condition establishes whether or not the algebraic value of an operand is negative, positive or zero. The operand can be either the numeric identif

Currency Sign - edit characters for numeric data: $ (Currency Sign): The single currency sign can appear at the leftmost place of a picture. In that situation the $ cha

single program how may when statement has used

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

ROUNDED OPTION: Let us consider the DATA DIVISION entries which are as shown below: Now, subsequent to the execution of the statement ADD A B GIVING C, the C will hold

RULES FOR OCCURS CLAUSE: The rules apply for the OCCURS clause and the subscripts are as shown below. (1) The integer in the OCCURS clause should be a positive integer.

How do I move a single QUOTE to a field or set the value clause? "''" does not work?

Example of Level numbers - cobol programming: To explain the hierarchical structure introduced above, the concept of the level number is employed in COBOL. The most broad

DISPLAY STATEMENT:   The function of the DISPLAY statement is just opposite to that of the ACCEPT statement. It is used to display the low-volume results on the operator's co