Arithmetic operators are used to perform arithmetic calculations. Java provides basic arithmetic operators. They are +,-, *, /, %. The different Arithmetic operators that were used in java programming.
Arithmetic operators
Operators |
Example |
Meaning |
+ - * / % |
a+b a-b a*b a/b a%b |
Addition (or) Unary plus Subtraction (or) Unary minus Multip Iication Division Modulo division (Remainder) |
class JavaArithmeticOperators
{
public static void main(String args[ ])
{
int a=15, b=9;
System.out.println("The Addition is : " +(a+b));
System.out.println("The Subtract is : "+(a-b));
System.out.println("The Multiple is : "+(a*b));
System.out.println("The Division is : " +(a/b));
System.out.println("The Modulo is : "+(a%b));
}
}
Dinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular Computer Notes blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.
Related Articles
Basic Courses
Advance Courses