Untitled
plain_text
18 days ago
455 B
0
Indexable
Never
#include <stdio.h> int main() { int input1, input2, output; printf("XOR Gate Truth Table:\n"); printf("Input 1 | Input 2 | Output\n"); printf("-------------------------\n"); for (input1 = 0; input1 <= 1; input1++) { for (input2 = 0; input2 <= 1; input2++) { output = input1 ^ input2; // XOR operation printf(" %d | %d | %d\n", input1, input2, output); } } return 0; }