Question: The following code has a syntax error immediately before the word else. What is the error and why does it arise? Fix the code so
The following code has a syntax error immediately before the word else. What is the error and why does it arise? Fix the code so that this statement is a legal if-else statement.
if (x < 0) ; x++;
else x--;
Step by Step Solution
3.44 Rating (163 Votes )
There are 3 Steps involved in it
The syntax error in the code arises because of the semi... View full answer
Get step-by-step solutions from verified subject matter experts
