Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
14
Task/Binary-digits/QBasic/binary-digits.basic
Normal file
14
Task/Binary-digits/QBasic/binary-digits.basic
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
FUNCTION BIN$ (N)
|
||||
N = ABS(INT(N))
|
||||
B$ = ""
|
||||
DO
|
||||
B$ = STR$(N MOD 2) + B$
|
||||
N = INT(N / 2)
|
||||
LOOP WHILE N > 0
|
||||
BIN$ = B$
|
||||
END FUNCTION
|
||||
|
||||
fmt$ = "#### -> &"
|
||||
PRINT USING fmt$; 5; BIN$(5)
|
||||
PRINT USING fmt$; 50; BIN$(50)
|
||||
PRINT USING fmt$; 9000; BIN$(9000)
|
||||
Loading…
Add table
Add a link
Reference in a new issue