|
The Basic |
|
|
Output:
Hello, World! |
|
|
Unlike |
|
|
Output:
Line 0 without trailing newlineLine 1 Line 2 |
|
|
|
|
|
Output:
String: hello |
|
|
|
|
|
Output:
Integer: 42 |
|
|
|
|
|
Output:
Float: 3.141590 |
|
|
|
|
|
Output:
Scientific: 1.234500e+03 |
|
|
|
|
|
Output:
Hex: ff |
|
|
|
|
|
Output:
Octal: 100 |
|
|
|
|
|
Output:
Character: A |
|
|
|
|
|
Output:
Percent: 100% |
|
|
Width and precision formatting. |
|
|
Output:
Width specifiers: | hello| |hello | | 42| |42 | Precision for floats: Default: 3.141593 2 decimals: 3.14 Width + precision: 3.14 Precision for strings (max length): Hello |
|
|
Zero-padding: |
|
|
Output:
Zero-padded: 00042 Zero-padded: 00003.14 |
|
|
Multiple arguments: |
|
|
Output:
Alice is 30 years old Bob is 25 years old |
|
|
Arguments cycle through format: |
|
|
Output:
first second third a 1 b 2 c 3 |
|
|
Escape sequences: |
|
|
Output:
Escape sequences: Tab: after tab Newline: after newline Backslash: \ Single quote: \' Bell: (beep) |
|
|
Hex and octal escape codes: |
|
|
Output:
Hex (41 = A): A Octal (101 = A): A |
|
|
Store |
|
|
Output:
Stored: Value: 00042 |
|
|
Bash
Bash can store |
|
|
Output:
Stored: Value: 00042 |
|
|
Bash
|
|
|
Output:
Number: 1 Number: 2 Number: 3 Number: 4 Number: 5 |
|