This is the output from the second printf statement:
printf("The value of average is %f",average);
The information in the Format String (the part
enclosed in double quotation marks) is literally printed
out as output. Where the %f Format Character is
situated within the Format String, the value of a specific
float is output. The argument AFTER the Format String
shows what specific value this will be: the value of the
variable average.
In this example, since the value of average is 2.5,
the output is:
The value of average is 2.500000
When the %f Format Character is used, 6 decimal places
will be given automatically. To alter that, one can modify
the Format Character:
%.2f will give 2 decimal places.
%.3f will give 3 decimal places.
%.4f will give 4 decimal places.
etc.