Why is it that scanf() needs the l in \"%lf\" when reading a double, when printf() can use \"%f
scanf()
l
%lf
double
printf()
%f
Because otherwise scanf will think you are passing a pointer to a float which is a smaller size than a double, and it will return an incorrect value.