Lecture 4 - Format Specifiers and Escape Sequences
Format specifiers Format specifiers are the special characters which govern the formatting of the variables on the screen. Format Specifier For (Data Type) Format Specifier For (Data Type) %d Signed Decimal Integer %s String %f Floating Point (decimal notation) %x Unsigned Hexadecimal Integer %c Character %o Unsigned Octal Integer %e Floating Point (exponential notation) l Prefix, e.g. %ld for long integer %u Un-signed Decimal Integer Table 4 – Format Specifiers /* This program demonstrates:- Declaration of Constants and Variables Use of Constant Variables Variable initialization Format Specifier Expression Function call ...