use %f instead of %lf (the 'l' is ignored anyways).