thecoderworld
  • About Us
  • Contact Us
  • Privacy Policy
  • Disclaimer
No Result
View All Result
  • Programming
  • Web Development
  • Best Of
    • Alternative
    • How To
    • Tech
    • AI
    • IDE
  • PC
    • Windows
    • Mac
    • Linux
  • Reviews
  • Open Source
  • Lists
  • Security
No Result
View All Result
thecoderworld
  • Programming
  • Web Development
  • Best Of
    • Alternative
    • How To
    • Tech
    • AI
    • IDE
  • PC
    • Windows
    • Mac
    • Linux
  • Reviews
  • Open Source
  • Lists
  • Security
No Result
View All Result
thecoderworld
No Result
View All Result
Home Tutorials Source Code Java

Java – Arithmetic Operators

Ajoy Kumar by Ajoy Kumar
July 1, 2019
in Java
2 min read
0
Share on FacebookShare on Twitter

This is the source code from the Java Tutorial For Beginners. In this source code, you are going to learn about in Arithmetic Operators in Java programming language.

In Java Programming Language there are five types of arithmetic operators. Here is the list of arithmetic


  • Multiplication (*)
  • Division (/)
  • Modular Division (%)
  • Addition (+)
  • Subtraction (-)

Source Code:

Addition

package applet;

public class Applet {
    public static void main (String args[]) {

       int x,y, answer;

       x = 20;
       y = 30;
       answer = x + y;

       Sysem.out.println("Answer = " + answer);
    }

}

Subtraction

package applet;

public class Applet {
    public static void main (String args[]) {

       int x,y, answer;

       x = 70;
       y = 30;
       answer = x - y;

       Sysem.out.println("Answer = " + answer);
    }

}

Multiplication

package applet;

public class Applet {
    public static void main (String args[]) {

       int x,y, answer;

       x = 20;
       y = 30;
       answer = x * y;

       Sysem.out.println("Answer = " + answer);
    }

}

Division

package applet;

public class Applet {
    public static void main (String args[]) {

       int x,y, answer;

       x = 90;
       y = 30;
       answer = x / y;

       Sysem.out.println("Answer = " + answer);
    }

}

Modular Operator


package applet;

public class Applet {
    public static void main (String args[]) {

       int x,y, answer;

       x = 91;
       y = 30;
       answer = x % y;

       Sysem.out.println("Answer = " + answer);
    }

}

Tags: java
Previous Post

Java - Create a Basic Calculator

Next Post

Java - Increment and Assignment Operators

Ajoy Kumar

Ajoy Kumar

I am an entrepreneur by heart and founder of thecoderworld. Who always follows his passion. I love writing about software, coding, open-source, technology, smartphones, tips and tricks

Related Posts

Constructors in java
Java

Java – Constructors

July 1, 2019
Set and Get Methods
Java

Java – Set and Get Methods

July 1, 2019
Methods and Instances
Java

Java – Methods and Instances

July 1, 2019

Stay Connected

  • 177 Fans
  • 41 Followers
  • 32 Followers
  • 8k Subscribers

Latest Posts

Data Recovery Software
Tech

5 Best Data Recovery Software for Windows

December 12, 2019
10 Powerful Websites that Can Replace Your PC Software
Top Lists

10 Powerful Websites that Can Replace Your PC Software

December 12, 2019
How to Install GIMP on Windows 10
Alternative

How to Install GIMP on Windows 10

December 10, 2019
thecoderworld

© 2016 - 2019 thecoderworld.com

Navigate Site

  • About Us
  • Contact Us
  • Privacy Policy
  • Disclaimer

Follow Us

No Result
View All Result
  • Programming
  • Web Development
  • Best Of
    • Alternative
    • How To
    • Tech
    • AI
    • IDE
  • PC
    • Windows
    • Mac
    • Linux
  • Reviews
  • Open Source
  • Lists
  • Security

© 2016 - 2019 thecoderworld.com