area of a traingle code example Example: triangle area formula double traingleArea = base * height / 2;