You used the wrong format for the printf commands.
Code:
$ gcc -W -Wall -ansi -pedantic -O2 foo.c
foo.c: In function `main':
foo.c:14: warning: int format, double arg (arg 2)
foo.c:15: warning: double format, different type arg (arg 2)