-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlab5.java
31 lines (26 loc) · 1.05 KB
/
lab5.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
import java.util.*;
public class lab5
{ //Program by Pranay Bokde
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
System.out.print("Enter the value of a:");
int a=sc.nextInt(); //taking value of first number a
System.out.print("Enter the value of b:");
int b=sc.nextInt(); //taking value of second number b
System.out.print("Enter the value of c:");
int c=sc.nextInt(); //taking value of third number c
if(a>b&&a>c) //comparing value of a from b and c
{
System.out.println("Number a is the largest :" +a);
}
else if(b>a&&b>c) //comparing value of b from a and c
{
System.out.println("Number b is the largest :" +b);
}
else
{
System.out.println("Number c is the largest :" +c); //not a or b but the c is the largest
}
}
}