Playing Compiler
Determine which of the following boolean expressions generate syntax errors, and in each case describe the error. For those expressions that are syntactically correct, determine the value of the expression.
Assume the following declarations:
int a = 2, b = 4, c = 7;
double x = 2.0, y = 3.14, z = −7.0;
boolean m = true, n = false;
a. ((a > 7) || (b<6))
b. ((a > 7) && (b<6))
c. ((x > 2.5) || (a == 2) && (c<7))
d. ((x = 2.0) && (c == 7))
e. (m = (!n && (m || n)))
f. (m == ((y == y/2) && (a == b)))
g. ((m == 0) || (z == 7.0))
h. (m && n && (a == b))
i. (c == -z) j. (m == a)
k. (( b/2 == x) && (2 * a == b))
l. ((int) (b/2) == (double) x)
m. (x + y + z + 1.86 != 0)
n. (a == x++)
o. ((int) m == 0)
p. ((x > z) || (m
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.