forked from deepdalsania/tutorials
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIf_Check.java
More file actions
47 lines (38 loc) · 1018 Bytes
/
If_Check.java
File metadata and controls
47 lines (38 loc) · 1018 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
package loop;
import java.util.Scanner;
public class If_Check {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
/*
* Scanner s = new Scanner(System.in);
* System.out.println("Enter any two positive number= "); int a = s.nextInt();
* int b = s.nextInt(); if (a > b && b != 0 ) {
* System.out.println("Division of"+" "+a+" "+"and"+" "+b+" "+"is: "+(a/b)); }
* else { System.out.println("Division is not possible."); }
*/
Scanner s = new Scanner(System.in);
System.out.println("Enter a = ");
int a = s.nextInt();
System.out.println("Enter b = ");
int b = s.nextInt();
System.out.println("Enter c = ");
int c = s.nextInt();
if (a > b) {
if (a > c) {
System.out.println("a is maximum= " + a);
} else {
System.out.println("c is maximum= " + c);
}
} else {
if (b > c) {
System.out.println("b is maximum= " + b);
} else {
System.out.println("c is maximum= " + c);
}
}
s.close();
}
}