-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstudent.java
More file actions
36 lines (34 loc) · 886 Bytes
/
student.java
File metadata and controls
36 lines (34 loc) · 886 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
import java.util.Scanner;
public class student {
void add(int a, int b)
{
int add = a +b;
System.out.println("The sum is :"+" "+add);
}
void sub(int a, int b)
{
int sub = a -b;
System.out.println("The sub is :"+" "+sub);
}
void mul(int a, int b)
{
int mul = a *b;
System.out.println("The mul is :"+" "+mul);
}
void div(int a, int b)
{
int div = a /b;
System.out.println("The div is :"+" "+div);
}
public static void main(String[]args) {
Scanner s = new Scanner(System.in);
student obj = new student();
System.out.println("Enter the numbers :");
int a = s.nextInt();
int b = s.nextInt();
obj.sub(a, b);
obj.mul(a , b);
obj.div(a , b);
obj.add(a , b);
}
}