Hi.I'm trying to "make" triangle validation with bool and float.And that is OK.My problem is how to "mutate" bool return into string so I can printf it.Yes,I'm total beginner,but I try. Thank's in advance.
TF.txt open in Sublime or ...
Code:
#include <stdio.h>
#include <cs50.h>
bool val_tri(float x, float y, float z);
int main(void)
{
float x = get_float("first side: ");
float y = get_float("second side: ");
float z = get_float("third side: ");
printf("triangl is %s.\n", tf);
}
bool val_tri(float x, float y, float z)
{
if (x < 0 || y < 0 || z < 0)
{
return false;
}
if ((x + y <=z) || (x + z <= y) || (y + z <= x))
{
return false;
}
return true;
}