so i included the math line
Code:
#include <math.h>
int isqrt(int n) {
int a = sqrt(n);
int b = 0
for (int i = 1; i <= a; i = i+1)
b = b +1;
return b;
}
and then i tried compiling with the -lm command so it looks like
Code:
gcc -std=c99 -O -o -lm isqrt isqrt-driver.c isqrt.c
and so now a few of the error messages went away.
isqrt.c: In function 'isqrt':
isqrt.c:4: error: parse error before "for"
isqrt.c:4: error: 'i' undeclared (first use in this function)
isqrt.c.4: error: (Each undeclared identifier is reported only once
isqrt.c:4: error: for each function it appears in.)
isqrt.c:4: error: parse error before ')' token