Arithmetic Operators

Question

ADDQUESTION

Solution

/**
 * Example 45 - Arithmetic Operators
 */
class ArithmeticOperators {

    public static void main(String[] args) {
        int max = 2147483647;
        int min = -2147483638;
        System.out.println(max+1);
        System.out.println(min-1);
        System.out.print(10 / 3);
        System.out.println(10/(-3));
        System.out.print(10 % 3);
        System.out.println(10%(-3));
        System.out.print((-10) % 3);
        System.out.println((-10) % (-3));
    }
}
Run this
Comments by Disqus