post
poster: G-man
description: Sqrt stuff
language: C
[download]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <stdio.h>
#include <math.h>
#define START 100 // number to start with
int main(void){
    double number = START;
    double root;
    while(1){
        root = sqrt(number);
        printf("Square root of %lf is %lf.\n",number,root);
        number = root;

    }
    return 0;
}

root@killbox:~/Desktop/C# gcc -o lol 1.c && ./lol
/tmp/ccGdvAMz.o: In function `main':
1.c:(.text+0x42): undefined reference to `sqrt'
collect2: ld returned 1 exit status