Views: 319

## Arithmetic Operators

Following are the list of Arithmetic Operators

Operator | Used For |
---|---|

+ | Addition |

- | Subtraction |

* | Multiplication |

/ | Division |

% | Remainder |

Following is a sample Java program shows you how to use them.

```
public class ArithmeticOperators {
public static void main(String[] args) {
int a = 10;
int b = 2;
int sum = a + b;
System.out.println("sum is:" + sum);
int substact = a - b;
System.out.println("substact is:" + substact);
int multiply = a * b;
System.out.println("multiply is:" + multiply);
int division = a / b;
System.out.println("division is:" + division);
int reminder = a % b;
System.out.println("reminder is: " + reminder);
}
}
```

#### Output

```
sum is:12
substact is: 8
multiply is: 20
division is: 5
reminder is: 0
```

### Other Arithmetic Operators

Operator | Used For |
---|---|

++ | Increment |

-- | Decrement |

+= | Addition Assignment |

-= | Subtraction Assignment |

*= | Multiplication Assignment |

/= | Division Assignment |

%= | Modulus Assignment |

On By
FastFoodCoding

#### Top Tutorials

460.7K

30.4K

20.8K

18.1K

17.4K

6.5K

6.1K

4.5K

3K

3K

#### Top Questions

17.5K

13.6K

8K

6K

5.5K

5.2K

4.5K

4.5K

4.2K

3.7K

#### Top Articles

1.8K

1.5K

879

#### Top Blogs

#### Top News

719

660

636

353

341

337