September 2017
Beginner
402 pages
9h 52m
English
Let us start with printing textual data:
| Directive | Description |
| %% | The % character |
| %c | A character |
| %s | A string |
Here are some examples of the directives in the preceding table:
printf "The percent sign: %%\n"; printf "Character %c\n", 167; printf "String %s\n", 'Hello, World';
This program prints the following lines:
The percent sign: % Character § String Hello, World
Notice that the %c directive treats the corresponding argument as a character, not as an integer.
Read now
Unlock full access