The following are the basic arithmetic operators used in programming:
- + : the sign indicating the operation of an Addition. Addition is when two numbers are added or combined to get an amount or total. It can also be the joining of two such as strings.
- example: int x = 5; int y = 4; int z = x+y; therefore, z = 9
- example: string wordOne = "go"; string wordTwo = "away"; string phrase = wordOne + " " + wordTwo; thereforem phrase = "go away"
- - : the sign indicating the operation of a Subtraction. Subtraction is used to find the difference between two values.
- * : the sign indicating the operation of a Multiplication. Multiplication is ued to add together values of the same cardiality.
- / : the sign indicating the operation of a Division. Division is used to see how many times a number is found in another number/
- mod : mod is Modulus in short. The modulus is the remainder given from a division.
- example: int result = 10 mod 6;