Ad

Find the area of a triangle from its width and height.

Code
Diff
  • float AreaOfTriangle(float w, float h) {return w * h * 0.5;} //Get one-lined
    • float AreaOfTriangle(float w, float h) {return (w * h) / 2;} //Get one-lined
    • float AreaOfTriangle(float w, float h) {return w * h * 0.5;} //Get one-lined