Jump to content

Count in octal: Difference between revisions

(→‎{{header|ALGOL W}}: fixed comment)
Line 292:
190 IF C THEN N$ = "1" + N$
200 GOTO 100</lang>
 
=={{header|Batch File}}==
<lang dos>
@echo off
:: {CTRL + C} to exit the batch file
 
:: Send incrementing decimal values to the :to_Oct function
set loop=0
:loop1
call:to_Oct %loop%
set /a loop+=1
goto loop1
 
:: Convert the decimal values parsed [%1] to octal and output them on a new line
:to_Oct
set todivide=%1
set "fulloct="
 
:loop2
set tomod=%todivide%
set /a appendmod=%tomod% %% 8
set fulloct=%appendmod%%fulloct%
if %todivide% lss 8 (
echo %fulloct%
exit /b
)
set /a todivide/=8
goto loop2
</lang>
{{out}}
<pre>
0
1
2
3
4
5
6
7
10
...
</pre>
 
=={{header|BBC BASIC}}==
Cookies help us deliver our services. By using our services, you agree to our use of cookies.