area of isosceles triangle in java
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// area of isosceles triangle
Scanner scanner = new Scanner(System.in);
System.out.print("Enter length of same side: ");
float equalLength = scanner.nextFloat();
System.out.print("Enter length of the other side: ");
float base = scanner.nextFloat();
float height = (float) Math.sqrt(Math.pow(equalLength,2) - (base / 4) );
double area = 0.5f * base * height;
System.out.printf("The area is %.2f",area);
}
}