[ create a new paste ] login | about

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

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

int main(void) {
    int a = 7; // 111
    int b = 2; // 010

    printf("%d", a ^ b); // ^ = XOR, 111 ^ 010 = 101 = 5

    return 0;
}


Output:
1
5


Create a new paste based on this one


Comments: