Java Examples

100+ tutorials, source code, and examples to help you develop creative and technical skills.

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.

Bottom-Navigation-Bar-with-Fragments-+-Animation
Bottom Navigation Bar with Fragments + Animation
Custom-Navigation-bar-with-Material-UI-design
Custom Navigation bar with Material UI design
How-to-create-Modern-Login-and-Register-screen-in-Android-Studio-|-Material-UI-Design-|-Part---06
How to create Modern Login and Register screen in Android Studio | Material UI Design | Part - 06

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.