Java-Arithmetic Operators

Operators

An operator is a symbol that takes one or more arguments and operates on them to produce a result. Operators are used in programs to manipulate data and variables.

Arithmetic Operators 

Arithmetic operators are used to construct mathematical expressions. The usual arithmetic operator +, -, *, / are used in java for addition, subtraction, multiplication, and division. The / operator denotes integer division if both arguments are integer, and floating-point division.

Program

1

Program Source

class Javaapp {

    public static void main(String[] args) {
        
        int a = 55,b=50;
        int c=a+b;
        int d=a-b;
        int e=a*b;
        int f=a/b;
        System.out.println("c = "+c);
        System.out.println("d = "+d);
        System.out.println("e = "+e);
        System.out.println("f = "+f);
    }
}

Leave a Comment