Problem with pow function

int i = 1234;
double f = 2.0;
double c;

c = pow ( 10.0, f );
i = i / c;

printf ("%d", i);

this code is giving the following prblem while compiling
exper.c:(.text+0x32): undefined reference to 'pow'
collect2: ld returned 1 exit status

btw i am using linux os and cc compiler.
I hope you included math.h header file!
yes i have included that but it is giving this error with gcc compiler but not with g++ compiler
Add -lm on the link line to link against the math library.

Topic archived. No new replies allowed.