-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlab7.java
32 lines (26 loc) · 1.05 KB
/
lab7.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
import java.util.*;
public class lab7
{ //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 to b and c
{
System.out.println("Number a is the smallest :" +a);
}
else if(b<a&&b<c) //comparing value of b to a and c
{
System.out.println("Number b is the smallest:" +b);
}
else
{
System.out.println("Number c is the smallest :" +c); //not a or b but the c is the smallest
}
}
}