Jump to content

Binary digits: Difference between revisions

PascalABC.NET
(Add Refal)
(PascalABC.NET)
Line 4,266:
Time 0.175 secs, average stringlength 62.000
..the obvious version takes about 1.1 secs generating the string takes most of the time..</pre>
=={{header|PascalABC.NET}}==
<syntaxhighlight lang="pascal">
begin
foreach var number in |5, 50, 9000| do
Writeln($'{number,4} - {Convert.ToString(number,2)}');
end.
</syntaxhighlight>
{{out}}
<pre>
5 - 101
50 - 110010
9000 - 10001100101000
</pre>
 
=={{header|Peloton}}==
<syntaxhighlight lang="sgml"><@ defbaslit>2</@>
Line 4,274 ⟶ 4,288:
<@ saybaslit>9000</@>
</syntaxhighlight>
 
=={{header|Perl}}==
<syntaxhighlight lang="perl">for (5, 50, 9000) {
153

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.