[an error occurred while processing this directive]

The printf statement

printf is C's basic command for formatted output.

Examples

     printf("Hello world\n");
     printf("%d + %d equals %d\n", x, y, x+y );
     printf("%s\n", reply);

In general

     printf( Format , E1 , E2, E3 ... En )
where

Width, Precision and Alignment

printf format codes

code type
%c character
%d signed integers
%i signed integers
%e exponential format
%E exponential format uppercase E
%f decimals
%g Use shortest of %e or %f
%G use shortest of %E or %f
%o octals
%s strings
%u unsigned integers
%x hexadecimals
%X hexadecimal with uppercase letters
%p pointers
%% the percent sign
[an error occurred while processing this directive]
Saturday, 15-Feb-1997 15:23:15 EST