I think you're actually confused about the %f in the first parameter to printf(). The first parameter is a string that can contain format specifiers like %f. When it sees %f, it looks for another parameter to the printf() function. That param must be a double. printf() converts the double to a string and substitutes the string for %f in the output.