[ create a new paste ] login | about

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

C, pasted on Dec 9:
1
2
3
4
5
6
7
8
9
10
11
12
#include <stdlib.h>
#include <stdio.h>

int main()
{
    unsigned i = 0xAAAAu;
    int x = 5;
    i = i & ((1 << x) - 1) | ((i & ~((1 << x) - 1)) << 1);

    printf("%x", i);
    return 0;
}


Output:
1
1554a


Create a new paste based on this one


Comments: