1Z0-803 · Question #234
1Z0-803 Question #234: Real Exam Question with Answer & Explanation
The correct answer is B: Compilation fails. The while statement is incorrect. It has the syntax of a for statement. The while statement continually executes a block of statements while a particular condition is true. Its syntax can be expressed as: while (expression) { The while statement evaluates expression, which must r
Question
Options
- Aii = 1
- BCompilation fails
- CThe program prints nothing
- DThe program goes into an infinite loop with no output
- EThe program goes to an infinite loop outputting:
Explanation
The while statement is incorrect. It has the syntax of a for statement. The while statement continually executes a block of statements while a particular condition is true. Its syntax can be expressed as: while (expression) { The while statement evaluates expression, which must return a boolean value. If the expression evaluates to true, the while statement executes the statement(s) in the while block. The while statement continues testing the expression and executing its block until the expression evaluates
Community Discussion
No community discussion yet for this question.