Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public class AreaOfTriangleBaseHeight {
public static void area(double base, double height){
double area = (base*height)/2;
System.out.println("Area of Triangle is: " + area);
}
public static void main(String[] args) {
double base = 4;
double height = 5;
area(base, height);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment