Arithmetic Examples

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:\]


[Back: SysWaitNamedPipe]
[Next: Using Comparisons]