Example of constructing an arithmetic expression, COBOL Programming

Example of constructing an arithmetic expression:

An arithmetic expression may be proceeded by a + or - sign. These operations are known as unary + or unary - operators.

Illustrations of the valid arithmetic expressions are:

1230_Rules for constructing an Arithmetic Expression2.png

Note that whenever the right-hand side of a COMPUTE verb is a single identifier or literal, then the effect is that of a MOVE statement.

Illustration:

                       COMPUTE    A = B + C

 

has similar effect as that of the ADD B  C  GIVING  A

Illustration:

                       COMPUTE     F =   1.8 * C + 32

The value of the expression on the right-hand side is computed and this value is then moved to the F.  Assume that the C & F are defined with pictures 99 & ZZ9.9 respectively and the present value of C is 3.  Subsequently after the execution of the statement, the F will have the value 37.4.

Posted Date: 10/16/2012 5:32:17 AM | Location : United States







Related Discussions:- Example of constructing an arithmetic expression, Assignment Help, Ask Question on Example of constructing an arithmetic expression, Get Answer, Expert's Help, Example of constructing an arithmetic expression Discussions

Write discussion on Example of constructing an arithmetic expression
Your posts are moderated
Related Questions

File Activity: The file activity is a measure of the proportion of records processed during an update run. Therefore we define the activity ration as shown below. Activi

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

GIVING    file-name-5. The input files to be merged through the MERGE statements which are specified in the USING phrase. These files should be sequential files and should be

PROGRAM FOR MASTER FILE MAINTENANCE: We have to write a program to keep the stu-file for which a record has just 2 fields,viz., rno(Roll Number) and name(Student Name). Give t

BLANK WHEN ZERO: BLANK WHEN ZERO is an editing clause that may be used along with a picture. This will set the whole data item to blanks of its value is equal to zero. Though,

Example of Sign condition: The illustration below describes the use of the sign condition. Illustration:     77  BALANCE  PIC  S9 (6) V99.       .       .     I

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.

cobol program for generate a eb bill

Illustration of the abbreviation: A few illustration of the abbreviation are given below: Illustration: The compound condition  AMOUNT GREATER THAN 499 AND AMOUNT L