user
You need to complete the following task:

Creat a function in C++ to calculate the area of a triangle.


assistant
float triangleArea(float base, float height) {
    float area;
    area = (base * height) / 2;
    return area; 
}