#include /********************************* * Examples of expressions mixing * relational, logical, bitwise, * and assignment operators * * Author: Sarah Heckman ********************************/ int main() { //First example using a bitwise XOR (^) unsigned char g, h; int a, b; float e, f; a = 2, b = 3, e = 4, f = 0, g = 1, h = 2; if ((a < b) && (e * f || (g ^ h))) { printf("true\n"); } else { printf("false\n"); } //Second example int z = -4; char c = 'D'; float y = 0.0, x = 22.2, w; w = (c == 'D') + (y || x) * z; float temp1 = (y || x); int temp2 = (c == 'D'); float temp3 = temp2 + temp1 * z; printf("%.2f %d %.2f\n", temp1, temp2, temp3); printf("%.2f\n", w); return 0; }