An **arithmetic operator** is a type of operator used to do some simple **mathematical** **stuff** in the **java** **programming** **language**.

An arithmetic operator is comprised of many mathematical functions to do the math stuff. Arithmetic Operators are **( +, -, *, /, %)**, we will see one by one with a perfect code example to understand what is happening in a code while using arithmetic operators.

**+ (Addition)**: The**+**is an operator that performs the additional math function using the operands/value we assign in a variable.**- (Subtraction):**The - is an operator which performs the subtraction math function using some of the operands/values we assign in a variable same as the + function.*** (Multiplication)**: The * is an operator which performs the multiplication math function using the operands we assign.**/ (Division)**: The / operator divides the assigned operand/value.**% (Modulus):**The modulus operator % divides the provided value and gives out the remainder/leftover.

## Example

```
package com.javaframework.test;
public class Testing
{
public static void main(String[] args)
{
int x = 50, y = 50;
System.out.println("+ : " +(x + y));
System.out.println("- : " +(x - y));
System.out.println("* : " +(x * y));
System.out.println("/ : " +(x / y));
System.out.println("% : " +(x % y));
}
}
```

**Output:**

```
+ : 100
- : 0
* : 2500
/ : 1
% : 0
```

- Log in to post comments