[ create a new paste ] login | about

Link: http://codepad.org/2oW9VHFj    [ raw code | output | fork ]

C++, pasted on Apr 23:
1
2
3
4
5
6
7
int main()
{
char str[] = "00000000000000000000000000000000";
int n = 1234;
for (int i = 0; i < 32; i++) if (((1 << i) & n) == (1 << i)) str[31 - i] = '1';
printf("%s", str);
}


Output:
1
00000000000000000000010011010010


Create a new paste based on this one


Comments: