The function printf() prints a formatted string to stdout.
void printf( char *format, ... )
The available format codes are:
%d decimal integer
%c character
%s string
%f floating-point number in decimal notation
%lf double number
%x hex integer
Example:
void main(void)
{
printf( "%d\n", 0x336 );
printf( "%x\n", 0x336 );
printf( "%s\n", "Hello World" );
printf( "%c\n", 'a' );
printf( "%f\n", 1.345 );
printf( "%lf\n", 3.20076 );
}
Output:
822
336
Hello World
a
1.345000
3.200760