previous | start | next

Formatted printing

printf("You input values %d and %d\n", x, y);

If the value of x is 5 and y is 10, this printf statement will output:

You input values 5 and 10

Other conversion specifications:

Conversion spec Expected value type
%d int
%f float or double
%c char
%s char array


previous | start | next