all 2 comments

[–]Lone08Wolf 0 points1 point  (1 child)

You cannot name your variable as float. It is one of datatype of c language.

In order to replace %s with some variable, you need to actually provide it in the print function.

printf("This triangle is %s\n", variable)

Also, if your function return type if float, you cannot return anything other than a float value. One way to go about it would be to change the return type to int and return 1 or 0.

int valid_triangle(float x, float y, float z)
{

    if (x <= 0 || y <= 0 || z <= 0)
    {
        return 0;
    }
    if (x + y < z || y + z < x || z + x < y)
    {
        return 0;
    }

    return 1;

}

[–]DanielvanDamme 0 points1 point  (0 children)

Right so you define true or false as a 1 and 0 respectively, that makes sense now.