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
OCCURS - INDEXED BY PROGRAM: identification division. program- id. searching. environment division. data division. working-storage section. 01 table1.      0

I uploaded a file from PC to Mainframe, variable LRCL 256. In my COBOL program I defined it as FD INPUT-FILE LABEL RECORDS ARE OMITTED BLOCK CONTAINS 0 RECORDING MODE

PROGRAM FOR DIVIDE VERB:   We have to write an easy program to elaborate DIVIDE verb. You can also use edit characters in the program. Identification division. Program-

Label Records / Disk Directory: The most important information stored in the header label is what is termed as the file title. In the situation of magnetic-disk files the labe

Introduction to MOVE Verb: The aim of this section is to introduce the learner how to move data from one place to the other place in the memory. This is completed with the help

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

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.

ROUNDED OPTION: Let us consider the DATA DIVISION entries which are as shown below: Now, subsequent to the execution of the statement ADD A B GIVING C, the C will hold

PERFORM WITH TIMES OPTION: The format of a PERFORM TIMES statement is as shown below: Illustration:   A)  Perform the para-2 5 times. In this situation the specifie

PERFORM STATEMENT:   The PERFORM statement can be used to execute the group of consecutive statements written elsewhere in the program. We refer to this group of statements a