C Format Specifiers: Everything You Need to Know | C programming
Introduction - 00:00
Explanation without code - 00:08
Explanation with Code - 03:38
Integer Format Specifier %d
The %d format specifier is implemented for representing integer values. The printf() function is used to print the integer value stored in the variable.
Float Format Specifier %f
The %f format specifier is implemented for representing fractional values. It is implemented within the printf() function for printing the fractional or floating value stored in the variable. You must use the %f format specifier whenever you need to print any fractional or floating data.
Character Format Specifier %c
The %c format specifier is implemented for representing characters. It is used with the printf() function for printing the character stored in a variable. You should incorporate the %c format specifier when you want to print character data.
String Format Specifier %s
The %s format specifier is implemented for representing strings. It is used in the printf() function for printing a string stored in the character array variable. When you have to print a string, you should implement the %s format specifier.
Unsigned Integer Format Specifier %u
The %u format specifier is implemented for fetching values from the address of a variable having an unsigned decimal integer stored in the memory. It is used within the printf() function for printing the unsigned integer variable.
Long Int Format Specifier %ld
The %ld format specifier is implemented for representing long integer values. It is implemented with the printf() function for printing the long integer value stored in the variable.