The following format strings can be used to specify data to be printed or read using the printf or scanf functions, or any of their variants; fprintf, sprintf, fscanf or sscanf .
Note that though all can be used with the printf variants, some are not available for scanf.
FORMAT STRING DECRIPTION scanf()
Numeric Values
%d Deciaml integer y
%f Floating point deciamal(Real number) y
%lf Double (Long Real numder) y
%e Exponential representation n
%u Unsigned (positive) integer n
%x Hexadeciamal integer y
%o Octal integer y
%g Automatically Selects Shorter of %f and %e n
Character Types
%c Single character y
%s Character String, Defined as char * y
No comments:
Post a Comment