Ad

With this function you can know the area of a given Triangle.

Code
Diff
  • float AreaOfTriangle(float w, float h) {
      
      return (w * h) / 2;
    } //For best pratices, it's better to have your code readable
    • float AreaOfTriangle(float w, float h) {return (w * h) / 2;} //Get one-lined
    • float AreaOfTriangle(float w, float h) {
    • return (w * h) / 2;
    • } //For best pratices, it's better to have your code readable