Anonymous user
Two identical strings: Difference between revisions
→{{header|Liberty BASIC}}
Line 2,152:
=={{header|Liberty BASIC}}==
<lang liberty basic>
maxN = Int(Len(DecToBin$(maxNumber))/ 2)
For i = 2 To 1000▼
Print "Value"," Binary"
'Since 1 is obviously not applicable,
'just count to ((2^maxN) - 2); Using "- 2" because
'we know that ((2^5) - 1) = 1023 which is > 1000
bin$ = DecToBin$(i)
'Let's format the output nicely
Print (((2^Len(bin$))*i) + i),Space$((maxN * 2) - Len(bin$;bin$));bin$;bin$
Print i;" - ";bin$▼
Next i
End
Line 2,178 ⟶ 2,176:
{{out}}
<pre>
10 1010
15 1111
36
45
54
63
136
153
170
187
204
221
238
255
528
561
594
627
660
693
726
759
792
825
858
891
924
957
990
=={{header|MAD}}==
|