%d expects an integer to be printed. printf returns the number of characters printed, and you print the string 5 char.
He first evaluates the internal print to find out how many characters were printed, and then evaluates the external print 5.
source share