/* * xor.c * Chapter 9 * By John Stile * Purpose: ask for two values(1 and 0 for TRUE or FALSE) * and then evalueates them according to the logic * of the exclusive or. * * // compile but don't link (don't load functions) * gcc -c Project2.c -o Project2.o * * // Compile but don't link (don't load functions) * gcc -c Project1.c -o Project1.o * * // Link objects, and includ math pow funciton * gcc Project2.o Project1.o -o Project2 * */ #include #include "Project1.h" int main(void) { int x,y; // delcare 2 ints printf("Input the first value (0 or 1):"); // prompt for input scanf("%d", &x); // read from stdin, // interpret as deciaml // assign to location of x printf("Input the second value (0 or 1):"); // prompt for input scanf("%d", &y); // read from stdin, // interpret as deciaml // assign to location of y printf("The result of operation"); printf("%d XOR %d: is %s\n", x,y,xor(x,y)?"TRUE":"FALSE" ); return 0; }