I was going through The C programming Language by K&R. Here in a statement to print a double variable it is written
printf(\"\\t%g\\n\", sum += atof(lin
%f and %g does the same thing. Only difference is that %g is the shorter form of %f. That is the precision after decimal point is larger in %f compared to %g