Final answer:
The switch statement in the question is not syntactically correct and should be modified to use constant values in the cases.
Step-by-step explanation:
The issue with the switch statement in the question is that it is not syntactically correct. The cases in a switch statement should contain constant values, not boolean expressions or comparisons. In this case, the cases should be modified to have constant values, such as:
switch (temp) { case -1: cout << "Temp is negative." << endl;break; case 0: cout << "Temp is zero." << endl;break; case 1: cout << "Temp is positive." << endl;break; }
Now the switch statement will compare the value of 'temp' with the constant values -1, 0, and 1, and execute the corresponding case.