Exercises—Calculating Arithmetic Expressions

Procedure

  1. What line of output does the following program produce?
    /****************************** REXX ******************************/
      pa = 1
      ma = 1
      kids = 3
      SAY "There are" pa + ma + kids "people in this family."
  2. What is the value of:
    1. 6 - 4 + 1
    2. 6 - (4 + 1)
    3. 6 * 4 + 2
    4. 6 * (4 + 2)
    5. 24 % 5 / 2

Results

ANSWERS
  1. There are 5 people in this family.
  2. The values are as follows:
    1. 3
    2. 1
    3. 26
    4. 36
    5. 2

Task Task

Feedback


Timestamp icon Last updated: Tuesday, 7 January 2014


http://pic.dhe.ibm.com/infocenter/cicsts/v5r1/topic/com.ibm.cics.rexx.doc//dfhrx/dfhrx00031.html