Arithmetic Operator
Arithmetic Operator
Theory: Operators are symbols that perform operations on variables and values. For
example, + is an operator used for addition, while * is also an operator used for multiplication.
Operators in Java can be classified into 5 types:
1. Arithmetic Operators
2. Assignment Operators
3. Relational Operators
4. Logical Operators
5. Bitwise Operators
Arithmetic Operators:
Arithmetic operators are used to perform arithmetic operations on variables and data. For
example, a + b;
Here, the + operator is used to add two variables a and b. Similarly, there are various other
arithmetic operators in Java.
Operator Operation
+ Addition
- Subtraction
* Multiplication
/ Division
% Modulo Operation (Remainder after division)
Program:
Output
Conclusion: