Arithmetic operators are used to perform calculations on numerical values, as well as to concatenate two or more string values.
The following is a list of Arithmetic Operators:
- + (Addition) : To add numerical values and to concatenate string values.
c=a+b; // c= 10
Name = First_Name + " " + Last_Name; // Name = John Smith
- - (Subtraction) : To perform subtraction between numerical values.
c=a-b; // c= 0
- * (Multiplication) : To perform multiplication of numerical values.
c=a*b; // c= 25
- / (Division) : To perform division of numerical values.
c=a/b; // c= 1
- % (Modulus) : To calculate the remainder when a numerical value is divided by another.
c=a%b; // c= 0
Data types applicable to Arithmetic Operators
- String (only for 'Addition' operator)
- Date-Time (only for 'Addition' and 'Subtraction' operators)