Sunday, December 27, 2015

Arithmetic Operators

Arithmetic Operators:




package javaapplication16;


public class ArithemiticOperatorDemo {
    public static void main(String[] args) {
        int a=10;
        int b=5;
        
        int c=a+b;
        int d=a/b;
        int e=a*b;
        int f=a%b;
        
        System.out.println("Arithmetic Operator Operation");
        System.out.println("Addition = "+a);
        System.out.println("Division = "+b);
        System.out.println("Multiplification = "+e);
        System.out.println("Modulus = "+f);
    }
}

OUTPUT:
Arithmetic Operator Operation
Addition = 10
Division = 5
Multiplification = 50
Modulus = 0

0 comments:

Post a Comment