Which of the following is a syntax error?

a) Having duplicate case statements in the same switch statement
b) Beginning and ending a switch statement body with braces
c) Preceding a case label with the default label in a switch statement
d) Failing to end a case with the break statement.

a) Having duplicate case statements in the same switch statement

Computer Science & Information Technology

You might also like to view...

A watermark is a graphic displaying in the background of a worksheet

Indicate whether the statement is true or false.

Computer Science & Information Technology

Given the function definition, which of the following are correct?

``` int func(int n, double d) { int j = n; double sum = 0; while( j >= 0) { sum += d; -j; } return sum; ``` a) returns 7*2 b) returns 7+2 c) returns 7! d) There is a syntax error in the program so it won’t run. e) It compiles but computes none of these.

Computer Science & Information Technology