printf.md (565B)
1 # printf 2 3 **Source:** C Programming Book 4 5 **Chapter:** 1.1 6 7 **Definition:** printf is a general purpose standard output function for printing text and variables. 8 9 ## Variable Insertion 10 11 The following is a non-exhaustive list of formatting options for printf to print out different data types: 12 13 - %d - Integer 14 - %4d - Right aligned integer with a width of 4 15 - %f - Float 16 - %6.1f - Float with six characters width one of which is on the right of the decimal. 17 - %o - Octal 18 - %x - Hex 19 - %c - Character 20 - %s - String 21 - %ld - Long