Posts

Showing posts from April, 2017

Error With The Code For A Valid Triangle Values Input

#include<stdio.h>
#include<cs50.h>
#include<math.h>

bool validtri(float x , float y , float z);

int main(void)

{
    printf("enter the value of x: \n");
    float x = get_float();
    printf("enter the value of y: \n");
    float y = get_float();
    printf("enter the value of z: \n");
    float z = get_float();
validtri(x,y,z);


}

bool validtri(float x , float y , float z)
{
    if(x <= 0 || y <= 0 || z <= 0)
    {
        return false;
    }
    if (((x+y) <= z) || ((y+z) <= x) || ((z+x) <= y) )
    {
        return false;
    }
    return true;
}



I Am getting An Error Not Returning True or False