1.6K
In this program we are going to find the Largest Among Three Numbers
public class Largest {
public static void main(String[] args) {
double n1 = 0.5, n2 = 1.9, n3 = 2.5;
if( n1 >= n2 && n1 >= n3)
System.out.println(n1 + " is the largest number.");
else if (n2 >= n1 && n2 >= n3)
System.out.println(n2 + " is the largest number.");
else
System.out.println(n3 + " is the largest number.");
}
}
What You get as Output , After running the program
2.5 is the largest number.
Happy Programming:)