Printing the values of variables will make use of the printf() function, which was used in Chapter 1 for creating a simple message. Sadly, you cannot simply place the variable names within the context of the message in order to print their values. Instead, you make use of different signifiers, which act as placeholders for the variables, and then follow the message itself with the list of variables to use. For example, the %d flag represents an integer:
int dob = 1947; printf ("You were born in the year %d.", dob);
When the application is run, the value of dob will be used in place of %d, resulting in the message You were ...