Count in octal: Difference between revisions
Content deleted Content added
Add LabVIEW |
→{{header|Matlab}} / {{header|Octave}}: octal counter |
||
Line 597: | Line 597: | ||
<lang Mathematica>x=0; |
<lang Mathematica>x=0; |
||
While[True,Print[BaseForm[x,8];x++]</lang> |
While[True,Print[BaseForm[x,8];x++]</lang> |
||
=={{header|MATLAB}} / {{header|Octave}}== |
|||
<lang Matlab> n = 0; |
|||
while (1) |
|||
dec2base(n,8) |
|||
n = n+1; |
|||
end; </lang> |
|||
Or use printf: |
|||
<lang Matlab> n = 0; |
|||
while (1) |
|||
printf('%o\n',n); |
|||
n = n+1; |
|||
end; </lang> |
|||
If a predefined sequence should be displayed, one can use |
|||
<lang Matlab> seq = 1:100; |
|||
dec2base(seq,8)</lang> |
|||
or |
|||
<lang Matlab> printf('%o\n',seq);</lang> |
|||
=={{header|Modula-2}}== |
=={{header|Modula-2}}== |