Skip to content

Instantly share code, notes, and snippets.

@thmain
Created June 3, 2018 02:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thmain/e48def93dc41228359e9a36604eff20f to your computer and use it in GitHub Desktop.
Save thmain/e48def93dc41228359e9a36604eff20f to your computer and use it in GitHub Desktop.
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