-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlab8.java
34 lines (27 loc) · 1.14 KB
/
lab8.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
import java.util.*;
import java.lang.Math;
public class lab8
{ //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
int d=Math.min(a,b); //using Inbulit function for minimum number
int e=Math.min(d,c); //using Inbulit function for minimum number
if(a==b&&a==c) //comparing value of a to b and c
{
//values are equal
System.out.println("All the numbers Are Equal.");
}
else
{
//smallest number is
System.out.println( "Is the Smallest Number:"+e);
}
}
}