OS/2 Procedures Language 2/REXX


Inf-HTML [About][Toc][Index] 0.9b (c) 1995 Peter Childs


Arithmetic Examples


This sample procedure named MATH.CMD shows you how to perform four 
arithmetic operations on variables: 

/* Performing arithmetic operations on variables */
a = 4
b = 2
c = a + b
SAY 'The result of 'a '+' b 'is' c
SAY
c = a * b
SAY 'The result of ' a '*' b 'is' c
SAY
c = a - b
SAY 'The result of ' a '-' b 'is' c
SAY
c = a / b
SAY 'The result of 'a '/' b 'is' c
EXIT
Your screen looks like this: 

[C:\]MATH
The result of 4 + 2 is 6

The result of 4 * 2 is 8

The result of 4 - 2 is 2

The result of 4 / 2 is 2

[C:\]
  

Inf-HTML End Run - Successful