Cobol Programs Using Arithmetic Verbs

Posted on
CobolCOBOL - Loop StatementsLoop

COBOL EXAMPLES. This section of the website hosts some COBOL example programs illustrating the use of various COBOL CLAUSE, COBOL KEYWORDS, COBOL VERBS etc. COBOL Arithmetic Verbs. Arithmetic Verbs 2 Types. ADD, SUBTRACT, MULTIPLY, DIVIDE verbs COMPUTE Verb / Arithmetic Symbols + Addition - Subtraction. What are the Arithmetic Operators in Cobol? Cobol has five standard arithmetic verbs, ADD. A Cobol program has to be designed and coded to compute the quadratic.

COMPUTE Verb All the arthemetic, that we can done using verb ADD, SUBTRACT, MULTIPLY, DIVIDE verbs can be done using COMPUTE statement. In COMPUTE statement, we need to use following operators to do arthemetic.

Operator Meaning + Add - Subtract. Exponentiation / Divide. Multiplication Format.

COBOL - Data Types

COMPUTE ROUNDED. = arithmetic-expression ON SIZE ERROR. Example 1 - COMPUTE WS-A = WS-B + WS-C - WS-D. Values in WS-B, WS-C will be added, WS-D value subtracted from that value and store the final result in WS-A.

Data-items values values before exectuion after execution WS-A 300 850.