Untitled
unknown
plain_text
2 years ago
455 B
6
Indexable
#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;
}
Editor is loading...