Home Segments Index Top Previous Next

59: Mainline

You arrange for basic arithmetic calculations using the +, -, *, and / operators for addition, subtraction, multiplication, and division:

6 + 3           // Add, evaluating to 9 
6 - 3           // Subtract, evaluating to 3 
6 * 3           // Multiply, evaluating to 18 
6 / 3           // Divide, evaluating to 2 
6 + y           // Add, evaluating to 6 plus y's value 
x - 3           // Subtract, evaluating to x's value minus 3 
x * y           // Multiply, evaluating to x's value times y's value 
x / y           // Divide, evaluating to x's value divided by y's value