forked from jamescarolina/java-programs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharithmetic.java
More file actions
54 lines (44 loc) · 794 Bytes
/
arithmetic.java
File metadata and controls
54 lines (44 loc) · 794 Bytes
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import java.util.Scanner;
class arithmetic
{
public static void main(String amal[])
{
Scanner input=new Scanner(System.in);
System.out.println("Enter a Number: ");
int x=input.nextInt();
System.out.println("Enter a Number: ");
int y=input.nextInt();
System.out.println("\n");
sum obj1=new sum(x,y);
diff obj2=new diff(x,y);
product obj3=new product(x,y);
divide obj4=new divide(x,y);
}
}
class sum
{ sum(int a,int b)
{
System.out.println("The Sum is : "+(a+b));
}
}
class diff
{
diff(int a,int b)
{
System.out.println("The Diffrence is : "+(a-b));
}
}
class product
{
product(int a,int b)
{
System.out.println("The product is : "+(a*b));
}
}
class divide
{
divide(int a,int b)
{
System.out.println("The Quotient is : "+(a/b));
}
}