[ create a new paste ] login | about

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

C++, pasted on Jun 21:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <stdio.h>

int main() {
    unsigned char byte = 205;
    fprintf( stdout , "%d" , (byte & 0x80)>>7 );
    fprintf( stdout , "%d" , (byte & 0x40)>>6 );
    fprintf( stdout , "%d" , (byte & 0x20)>>5 );
    fprintf( stdout , "%d" , (byte & 0x10)>>4 );
    fprintf( stdout , "%d" , (byte & 0x8)>>3 );
    fprintf( stdout , "%d" , (byte & 0x4)>>2 );
    fprintf( stdout , "%d" , (byte & 0x2)>>1 );
    fprintf( stdout , "%d" , (byte & 0x1) );
    return 0;
}


Output:
1
11001101


Create a new paste based on this one


Comments: