Implementation
Go

Be concise.

Be useful.

All contributions dictatorially edited by webmasters to match personal tastes.

Please do not paste any copyright violating resource.

Please try to avoid dependencies to third-party libraries and frameworks.

Other implementations
import "fmt"
import "math/big"
s := fmt.Sprintf("%b", x)
import std.conv;
auto s = to!string(13,2);
var Iter,n:integer;
[...]
  S := '';
  for Iter := 0 to n do
    s:= Char(Ord('0')+(x shr Iter) and 1) + S;   
let s = format!("{:b}", x);
$s = sprintf("%b", $x);
StrUtils;
var
  _x: Integer;
  _s: String;
begin
  _s := IntToBin(_x,8*SizeOf(Integer));
end.
var s = i.toRadixString(2);
s = sprintf "%b", 13;
import Numeric (showIntAtBase)
import Data.Char (intToDigit)
s x = showIntAtBase 2 intToDigit x ""
s = x.to_s(2)
s = Integer.to_string(x, 2)
s = '{:b}'.format(x)
S = io_lib:format("~.2B~n", [X]).
String s = Integer.toBinaryString(x);
var base10number = 123

var base2number = base10number.toString(2)
local s = {}

while x > 0 do
    local tmp = math.fmod(x,2)
    s[#s+1] = tmp
    x=(x-tmp)/2
end

s=table.concat(s)
Convert.ToString(42,2);
// Prints : 101010
Convert.ToString(42, 2).PadLeft(8, '0');
// Prints  00101010
write (unit=s,fmt='(B0)') 13 ! just the string length
write (unit=s,fmt='(B32)') 13 ! Fills it up with zeros
#include <bitset>
std::bitset<sizeof(x)*8> y(x);
auto s = y.to_string();