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
PROGRAM FOR MOVE CORRESPONDING: We have to write a simple program to demonstrate Move Corresponding. identification division.   program- id.   environment division.

ACCEPT STATEMENT: The ACCEPT statement is used to read the low-volume data from the operator's console, several other hardware device or from the operating system. The common

RULES OF RENAMES CLAUSE:   The rules below should be observed while using the RENAMES clause: (i) All RENAMES entries should be written only after the last record descript

CLOSE STATEMENT: When the processing of a file is completed, then the file may be closed. This is completed with the help of the CLOSE-verb. The form of the CLOSE statement is

FILE DESCRIPTION- FIXED-LENGTH RECORDS: The normal characteristics of a file are explained in the file description (FD) entry of the DATA DIVISION.

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

READ STATEMENT: The aim of this verb is to make available the next logical record from the input file. It is important to note the meaning of the "next" logical record in the

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

PROGRAM FOR ELECTRICITY BILL: An electricity company supplies electricity to 4 types of customers coded 1, 2, 3 & 4.The rate schedule for customers is shown in one table as

Example of compound condition: In common, a compound condition has the form which is as shown below: Where condition-1 & condition-2 can be any one of the below: