-
Notifications
You must be signed in to change notification settings - Fork 0
/
Cheak.java
60 lines (36 loc) · 1.25 KB
/
Cheak.java
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
import java.util.Scanner;
public class Cheak {
public static void main (String[] args)
{
Scanner read1 = new Scanner(System.in);
System.out.print("Enter what you wont max or min : ");
String value = read1.next();
if ( value == "max"){
max();
}
else if (value == "min"){
min();
}
else {
System.out.println("Invalid value");
}
}
public static void max (){
Scanner read = new Scanner(System.in);
System.out.print("Enter First Number : ");
int number1 = read.nextInt();
System.out.print("Enter Second Number : ");
int number2 = read.nextInt();
int output = number1 + number2;
System.out.println("Output is : " + output);
}
public static void min (){
Scanner read = new Scanner(System.in);
System.out.print("Enter First Number : ");
int number1 = read.nextInt();
System.out.print("Enter Second Number : ");
int number2 = read.nextInt();
int output = number1 - number2;
System.out.println("Output is : " + output);
}
}