1
Vývoj / V C nefunguje funkce sqrt()
« kdy: 20. 04. 2012, 17:46:49 »
mam otazku, preco mi v linuxe nefunguje tento program? Skusal som to spustit v Netbeans, aj rucne skompilovat v terminali, ale stale mi to vyhadzuje chyby. V terminali som zadal: gcc -lm odmocnina.c a ono mi to vypisuje : undefined reference to `sqrt' collect2: ld returned 1 exit status
Kód: [Vybrat]
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main(int argc, char** argv)
{ double c;
scanf("%lf",&c);
c=sqrt(c);
printf("%lf",c);
return (EXIT_SUCCESS);
}