I don't know how to implement sqrt() function in C languge.
Every time I call a compiler I get this error
function sqrt not declared
I looked at C standard libray reference and from my perspective everthing is O.K
Here is the code
// Program asks user to enter the sides of the triangle
// and then test if triangle is isoscelesm , right-angled, equilateral
// Solution for exercise 17 (chapter 5)
// Date of creation: 15/02/2011
#include <stdio.h>
#include <math.h>
int main(void) {
float a,b,c;
// Asks user to enter sides
printf("\t\tTriangle detection triangle\n");
printf("Enter three sides of the triangle: ");
scanf("%f, %f, %f", &a, &b, &c);
if (a <= 0 || b <= 0 || c <= 0) {
printf("Invalid input\n");
return 1;
}
else if (a + b > c && a + c > b && b + c > a) {
printf("Valid entry!\n");
}
if ( a != b && a != c && b != a && b != c && c != a) {
printf("isoscelesm\n");
}
else if ( a == b && a == c ) {
printf("equilateral\n");
}
else if ( b == a && b == c ) {
printf("equilateral\n");
}
else if ( c == a && c == b) {
printf("equilateral\n");
}
else if (c == sqrt (a * a + b * b)) {
printf("equilateral\n");
}
return 0;
}