#include /* This illustrates the use of the six relational operators, and the misuse of the assignment operator. */ void main (void) { int x = 1; int y = -2; int z = 0; /* Example 1. Greater than. */ if (x > 0) { printf("Test 1 is true\n"); } else { printf("Test 1 is false\n"); } /* Example 2. Greater than or equal to. */ if (y*y >= 1) { printf("Test 2 is true\n"); } else { printf("Test 2 is false\n"); } /* Example 3. Less than. */ if (z < x) { printf("Test 3 is true\n"); } else { printf("Test 3 is false\n"); } /* Example 4. Less than or equal to. */ if (z <= 1) { printf("Test 4 is true\n"); } else { printf("Test 4 is false\n"); } /* Example 5. Equal to. */ if (y == -2*x) { printf("Test 5 is true\n"); } else { printf("Test 5 is false\n"); } /* Example 6. Not equal to. */ if (y != z) { printf("Test 6 is true\n"); } else { printf("Test 6 is false\n"); } /* Example 7. Misuse of assignment to mean equality. */ if (z = z) { printf("Test 7 is true\n"); } else { printf("Test 7 is false\n"); } }