C Managing Input ⁄ Output Operations

Conversion Strings and Specifiers

The printf ( ) function is quite flexible.
It allows a variable number of arguments, labels and sophisticated formatting of output. The general form of the printf ( ) function is

Syntax : Printf (“conversion string”, variable list);

The conversion string includes all the text labels, escape character and conversion specifiers required for the desired output.
The variable includes all the variable to be printed in order they are to be printed. There must be a conversion specifies after each variable.

Specifier Meaning

%c – Print a character 
%d – Print a Integer 
%e – Print float value in exponential form. 
%f – Print float value 
%g – Print using %e or %f whichever is smaller 
%o – Print actual value 
%s – Print a string 
%x – Print a hexadecimal integer (Unsigned) using lower case a – F
%X – Print a hexadecimal integer (Unsigned) using upper case A – F 
%a – Print a unsigned integer. 
%p – Print a pointer value 
%hx – hex short 
%lo – octal long 
%ld – long 
        

Make Comments..!!


Oops!! No posts from user.

Download Android App