Views: 267

## 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

327.3K

26.4K

18.2K

16.3K

14.1K

5.7K

4.6K

3.5K

2.6K

2.3K

#### Top Questions

14.4K

10.8K

6.8K

4.4K

4K

3.6K

3.6K

3.6K

3.1K

2.9K

#### Top Articles

1.5K

1.4K

699

#### Top Blogs

#### Top News

607

545

521

239

228

189