[ create a new paste ] login | about

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

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

int main(){
	puts("XOR");
	int a,b;
	for(a=0;a<2;a++)
		for(b=0;b<2;b++)
			printf("%i %i -> %i\n",a,b,(a | b) & (~(a & b)));
	return 0;
}


Output:
1
2
3
4
5
XOR
0 0 -> 0
0 1 -> 1
1 0 -> 1
1 1 -> 0


Create a new paste based on this one


Comments: