Count in octal: Difference between revisions

Line 1,776:
<syntaxhighlight lang="java">
void printCount() {
for (int value = 10; value <= 20; value++) {
if (value != 1)
System.out.print(", ");
/* the 'o' specifier will print the octal integer */
System.out.printf("%o%n", value);
}
}
</syntaxhighlight>
<pre>
0
1, 2, 3, 4, 5, 6, 7, 10, 11, 12, 13, 14, 15, 16, 17, 20, 21, 22, 23, 24
1
2
3
4
5
6
7
10
11
12
13
14
15
16
17
20
21
22
23
24
</pre>
<br />
118

edits