Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

Java Arithmetic Operators

class Main {
  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));
  }
}
Comment

PREVIOUS NEXT
Code Example
Java :: why are there no destructors in java? 
Java :: initialize class java 
Java :: hide elements android 
Java :: sqlexception 
Java :: set java home sdk macbook 
Java :: java read keyboard input 
Java :: how to do infinte loop in java 
Java :: upload byte array to oss 
Java :: how to make a copy of an array java 
Java :: java text file to arraylist 
Java :: matrix multiplication in java 
Java :: android play sound file from assets 
Java :: java mp3 player 
Java :: java list distinct by attribute 
Java :: find min in array java 
Java :: calendar.year java 
Java :: final method meaning 
Java :: How to print in console java 
Java :: check key is pressed java 
Java :: How to determine whether a graph contains a cycle, in Java? 
Java :: str.substring last 2 java 
Java :: java Write a program to reverse an array or string 
Java :: intent pick action video android 
Java :: for each loop java 
Java :: fill two dimensional array java 
Java :: react The href attribute is required for an anchor to be keyboard 
Java :: default argument in java 
Java :: java get length of a string 
Java :: param query spring boot 
Java :: java string to byte array utf8 
ADD CONTENT
Topic
Content
Source link
Name
7+6 =