Arithmetic Operators
Arithmetic operators are used in mathematical expressions in the same way that they are used in algebra. The following list describes arithmetic operators. Assume integer variable A holds 20 and variable B holds 40.
S.No. Arithmetic Operator & Description
1
+ (Addition)
Adds values on either side of the operator. Example: A + B will give 60.
2
− (Subtraction)
Subtracts right hand operand from left hand operand. Example: A − B will give -20.
3
* (Multiplication)
Multiplies values on either side of the operator. Example: A * B will give 800.
4
/ (Division)
Divides left hand operand by right hand operand. Example: B / A will give 2.
5
MOD (Modulus)
Divides left hand operand by right hand operand and returns the remainder. Example: B MOD A will give 0.
Example
REPORT YS_SEP_08.
DATA: A TYPE I VALUE 150,
B TYPE I VALUE 50,
Result TYPE I.
Result = A / B.
WRITE / Result.
Serkan AKKAVAK
Computer Engineer BSc
SAP Department Manager
Contact : serkurumsal@yandex.com
0 Comments