-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClass3.java
More file actions
29 lines (24 loc) · 1.2 KB
/
Class3.java
File metadata and controls
29 lines (24 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
public class Class3 {
public static void main(String[] args){
int a= 20;
int b= 10;
int addition= a+b;
int subtraction= a-b;
int multiplication= a*b;
int division= a/b;
System.out.println("=========Method 1=========");
System.out.println("Addition of a and b is: "+ addition);
System.out.println("Subtraction of a and b is: "+ subtraction);
System.out.println("Multiplication of a and b is: "+ multiplication);
System.out.println("Division of a and b is: "+ division);
System.out.println("=========Method 2=========");
System.out.println("Addition of a and b is: "+ (a+b));
System.out.println("Subtraction of a and b is: "+ (a-b));
System.out.println("Multiplication of a and b is: "+ (a*b));
System.out.println("Division of a and b is: " + (a/b));
System.out.println("-----------------------------------------");
System.out.println("Addition: " +(a+b) +" Subtraction: " + (a-b) + " Multiplication: "+ (a*b) +" Division: " + (a/b));
System.out.println("-------------------------------------------");
System.out.println("Thank You");
}
}