Java Sip for the day – 7th October 2019

Java program to perform basic operations

public class Operator{

    public static void main(String[] args) {
       int a = 10;
       int b = 5;

                int add = a+b;
		int sub = a-b;
		int mul = a*b;
		int div = a/b;
		int mod = a%b;
		
		System.out.println(add);
		System.out.println(sub);
		System.out.println(mul);
		System.out.println(div);
		System.out.println(mod);

    }

}

Facebook Comments

Leave a Reply

Your email address will not be published. Required fields are marked *