Java Program to use Arithmetic Operators
ArithmeticOperators .java
/* Code From Learnoset - Learn Code Online Android App.*/
/*Download Learnoset App from PlayStore to learn coding*/
//Java Program to use Arithmetic Operators in java
class ArithmeticOperators {
public static void main(String[] args) {
// declare variables
int a = 12, b = 5;
// addition operator
System.out.println("a + b = " + (a + b));
// subtraction operator
System.out.println("a - b = " + (a - b));
// multiplication operator
System.out.println("a * b = " + (a * b));
// division operator
System.out.println("a / b = " + (a / b));
// modulo operator
System.out.println("a % b = " + (a % b));
}
}
/*----------OUTPUT----------
a + b = 17
a - b = 7
a * b = 60
a / b = 2
a % b = 2
*/
Projects with Source Code + Video Tutorials
You can download our Java and Android Studio Projects with Source Code and Video Tutorials.
Login & Register Screen UI Design - 02
Login & Register Screen UI Design - 01
Simple Music Player App for Android (Offline Version)
If you have any Questions or Queries
You can mail us at info.learnoset@gmail.com
Follow us to learn Coding and get in touch with new Technologies.