Find highest three integer Java Example

Find highest three integer Java Example

Question: Given the list of integers please find the highest product you can get from three of the integers. Note: The input list of integers will always have at least three integers.

  • MaxOfThreeInt.java:
public class MaxOfThreeInt {

	public static void main(String[] args) {
		
		int x = 15;
		int y = 20;
		int z = 10;
		
		int max = Math.max(Math.max(x, y),z);
		
		System.out.println("Max of three int: "+ max);

	}

}
  • Output:

Find highest three integer Java Example

Reference:

Leave a Reply

Your email address will not be published. Required fields are marked *