WAP to add,subtract,multiply and divide two numbers.

1 year ago
OOP Java

Compile code:

class Number{
public static void main(String[] args) {
        
      int first =20;
      int second=30;
      int sum=first+second;
      int diff=first-second;
      int mul=first*second;
      int div=first/second;
      
     System.out.println("The sum is: "+sum);
     System.out.println("The multiple is: "+mul);
     System.out.println("The division is: "+div);
}

}

Output:

0
Dipti KC
Jan 8, 2023
More related questions

Questions Bank

View all Questions