Java Program to Find Minimum Height of the Triangle with Given Base and Area

bookmark

import java.util.Scanner;
public class Main
{
    public static void main(String[] args)
    {
        // Static values
        double base = 20, area= 100;
        // Calculating the minimum height of the triangle
        double minHeight = (2*area)/base;
        // Rouding it to the next whole number
        minHeight = Math.ceil(minHeight);
        System.out.println("The minimum height of the triangle is "+minHeight);
    }

 


Output:

The minimum height of the triangle is 10.0