Top

Language Fundamentals - General Questions

6.

Variables declared inside a for loop are limited in scope to the loop.

Answer: B

Any variable declared within a block statement such as a for or if cannot be referenced outside the block.

Enter details here

7.

For the [removed]y >= z && a == b) to be true, at least one of (y >= z) and (a == b) must be true.

Answer: B

For the result of a "&&" operation to be true, both operands must be true.

Enter details here

8.

break statement must always be present in the default case of a "switch" selection structure.

Answer: B

The break statement, which brings the computation out of the "switch" selection structure, is not required for the defalut case.

Enter details here

9.

The "switch" selection structure must end with the default case.

Answer: B

The default case in a switch structure is optional and only used when none of the other cases match.

Enter details here

10.

The [removed]y >= z && a == b) is evaluated by first evaluating the expression y >= z, and then evaluating a == b.

Answer: B

If y >= z is false, then there is no need to evaluate the second expression.

Enter details here

Loading…