-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAssignment32.java
More file actions
102 lines (57 loc) · 2.08 KB
/
Assignment32.java
File metadata and controls
102 lines (57 loc) · 2.08 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
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
package abhilash_Asignments;
//Using scanner class static and nonstatic lets do Addition,Substraction , Multiplicaion division and modulus of 4 diff method.
import java.util.Scanner; //import java utile
public class Assignment32 { //class
//creating scanner globally
static Scanner s1 = new Scanner(System.in); //scanner class
static void add() //static method
{
//System.out.println("Addition" );
//System.out.println("enter the A number-->");
int a = s1.nextInt();
//System.out.println("enter the B number");
int b = s1.nextInt();
int add = a+b;
System.out.println("result-->" + add);
}
static void sub()
{
System.out.println("Subtraction");
System.out.println("enter the number int a");
int a = s1.nextInt();
System.out.println("enter the number int b");
int b = s1.nextInt();
int sub = a-b;
System.out.println("result-->" + sub);
}
static void mul()
{
System.out.println("Multipcation");
System.out.println("Enter the a value ");
int a = s1.nextInt();
System.out.println("enter the number int b");
int b = s1.nextInt();
int mul = a*b;
System.out.println("result-->" + mul);
}
static void div ()
{
System.out.println("Division");
System.out.println("eneter the value a");
int a = s1.nextInt();
System.out.println("Enter the value b");
int b = s1.nextInt();
int div = a/b;
System.out.println("result-->" + div);
}
static void modulas()
{
System.out.println("modules");
System.out.println("Enter the value of a");
int a = s1.nextInt();
System.out.println("enter the second value b");
int b = s1.nextInt();
int modulas = a % b;
System.out.println("result-->" + modulas);
}
}