|
The function printf() outputs text (generally) to the console
- via a stream known as stdout (standard output).
The characters responsible for formatting the output text
are shown in purple.
int counter = 4;
double x_coord = 0.123;
char text[] = { "hello" };
char c = 'A';
printf("simple message text\n");
printf("counter is %d\n", counter);
printf("x_coord with trailing zero's is %f\n", x_coord);
printf("x_coord to 3 decimal places is %1.3f\n", x_coord);
printf("text without quotations %s\n", text);
printf("text with embedded quotations \"%s\"\n", text);
printf("multiple items %d and %f\n", counter, x_coord);
printf("a single character %c\n", c);
|