area of scalene triangle in java
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// area of scalene triangle
Scanner scanner = new Scanner(System.in);
System.out.print("Enter the sides (a,b,c): ");
float side1 = scanner.nextFloat(), side2 = scanner.nextFloat(), side3 = scanner.nextFloat();
float semiPerimeter = (side1 + side2 + side3) / 2;
double area = Math.sqrt( semiPerimeter * (semiPerimeter-side1) * (semiPerimeter-side2) * (semiPerimeter-side3) );
System.out.printf("The area is %.2f",area);
}
}