Answers for "in c check if triangle is a right triangle"

C
-1

in c check if triangle is a right triangle

int IsRightTriangle(float a, float b, float c)
{
    if((a*a + b*b == c*c) || (b*b + c*c == a) || (a*a + c*c == b*b)){
        return 1; //returns 1 if it's a right triangle
    }else{
        return 0; // returns 0 if it isn't a right triangle
    }
}
Posted by: Guest on April-27-2022

Code answers related to "C"

Browse Popular Code Answers by Language