#include <stdio.h>
#include <math.h>
main()
{
float x, y, z, d = 0;
printf("Please enter value for x:\n");
scanf("%f", &x);
printf("Please enter value for y:\n");
scanf("%f", &y);
printf("Please enter value for z:\n");
scanf("%f", &z);
d = sqrt((x*x) + (y*y) + (z*z));
printf("The distance to your point was %f\n", d);
}
-bash-3.2# vi pythogoros.c
-bash-3.2# cc -o pythogoros pythogoros.c
/tmp/cc31sDdi.o: In function `main':
pythogoros.c
.text+0xb0): undefined reference to `sqrt'
collect2: ld returned 1 exit status
I have typed the above program in vi editor and saved and compiled as mentioned above i am getting error message:
/tmp/cc31sDdi.o: In function `main':
pythogoros.c
.text+0xb0): undefined reference to `sqrt'
collect2: ld returned 1 exit status
will somebody help me on this. I am running the Fedora 10 OS.