Jump to content

Count in octal: Difference between revisions

no edit summary
m (→‎BASIC: added to 'see also')
No edit summary
Line 264:
=={{header|Common Lisp}}==
<lang lisp>(loop for i from 0 do (format t "~o~%" i))</lang>
 
=={{header|Component Pascal}}==
BlackBox Component Builder
<lang oberon2>
MODULE CountOctal;
IMPORT StdLog,Strings;
 
PROCEDURE Do*;
VAR
i: INTEGER;
resp: ARRAY 32 OF CHAR;
BEGIN
FOR i := 0 TO 1000 DO
Strings.IntToStringForm(i,8,12,' ',TRUE,resp);
StdLog.String(resp);StdLog.Ln
END
END Do;
END CountOctal.
 
</lang>
Execute: ^Q CountOctal.Do<br/>
Output:
<pre>
0%8
1%8
2%8
3%8
4%8
5%8
6%8
7%8
10%8
11%8
12%8
13%8
14%8
15%8
16%8
17%8
20%8
21%8
22%8
</pre>
 
=={{header|D}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.