Rules for constructing an arithmetic expression, COBOL Programming

Rules for constructing an Arithmetic Expression:

The rules for constructing an arithmetic expression are as shown below:

(i) When an arithmetic expression specifies a calculation, it may consist of two or more numeric literals and/or data names joined by the arithmetic operators. The following table lists some of the operations and their meaning.

294_Rules for constructing an Arithmetic Expression.png

There should be at least one space preceding and the operator in an arithmetic expression is as shown below. No two arithmetic operators can appear altogether in an expression. In this respect the ** is considered as a single operator.

(i) Parentheses may be used to indicate the order of the operations in an arithmetic expression. Where the parentheses are absent, then the order is taken to be left to right as shown:

1010_Rules for constructing an Arithmetic Expression1.png

Whenever the parentheses are used, the part of the expression enclosed within the parentheses is computed first. 

Posted Date: 10/16/2012 5:30:39 AM | Location : United States







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

Write discussion on Rules for constructing an arithmetic expression
Your posts are moderated
Related Questions
Example of Move corresponding: Consider the DATA DIVISION entries shown below. Suppose it is needed that the data stored in the 4 fields of the PAY_REC should be

Example of Nested if statement: Illustration: Consider the following sentence The nested IF sentence holds two IFs and one ELSE. The IF-ELSE couple has been marke

PROGRAM FOR INDEXED SEQUENTIAL FILE CREATION: We have to write a program to create an Indexed Sequential File in a dynamic mode for Student particulars. Suppose just 3 fields:

Comparison of the Numeric Operand with Nonnumeric Operand: The numeric operand can be compared to the nonnumeric operand subject to the restrictions which are as follows.

Illustration of if- else statement: IF OK-BALANCE NEXT SENTENCE ELSE MOVE 2 BALANCE-CODE In this illustration, the OK-BALANCE is a condition name. No action is specific if

Example of Open statement: Illustration: The OPEN INPUT TRANSACTION, OLD-MASTER OUTPUT NEW-MASTER. The illustration represents that there are two input files named the

/ (Slash Insertion): The edit character slash (/) also termed as virgule or stroke, may appear anyplace in the picture. When used, it will be inserted. More than one slash can

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

OCCURS - INDEXED BY PROGRAM: identification division. program- id. searching. environment division. data division. working-storage section. 01 table1.      0

FILE-CONTROL ENTRIES FOR THE SEQUENTIAL FILES: The characteristics of each and every files handled in a program are specified in the ENVIRONMENT DIVISION and DATA DIVISION.