-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlab6.java
33 lines (26 loc) · 1.11 KB
/
lab6.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
import java.util.*;
import java.lang.Math;
public class lab6
{ //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.max(a,b); //using Inbulit function for maximum number
int e=Math.max(d,c); //using Inbulit function for maximum 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
{
System.out.println( "Is the Largest Number:"+e); //largest number is
}
}
}