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
Example of Class condition: Let the BASIC-PAY be a data name in the card record defined with picture 9(5) V99. By reading the card we can test the value of the BASIC-PAY to ma

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

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.

PERFORM WITH VARYING OPTION: The format is as shown below:

PROGRAM FOR INVENTORY  We have to write a program to update the inventory file. Consider 2 files,viz, invfile an tranfile. Invfile has 3 fields pno,name,qty. Tranfile has 3 fil

SEQUENTIAL FILES WITH THE VARIABLE-LENGTH RECORDS: The Magnetic - tape or disk files can hold variable-length records. In this situation the file can have records with various

Environment Division: The Environment Division is the second division in the COBOL source program. It is mainly machine-dependent . The computer and all the peripheral dev

Selection of file Organization: While designing a file, the programmer should select an appropriate association for a file. The order in which the choice is to be made is as s

Transaction file : A transaction file is a file which contains new records those changes to old records which are used to update the master file. The problem of file updatio

Introduction to COBOL: In the year 1959, a new language named the COBOL ( CO mmon B usiness O riented L anguage) was introduced remembering the business purpose application