Question
java
QUESTION 4 Which of the following statements about a do...while repetition statement is true? A. The body of a do...while loo
0 0
Add a comment Improve this question Transcribed image text
Answer #1
(4)Answer: C. The body of a do...while loop is always executed at least once.

Explanation: Syntex of do...while loop is like as:

do {
    .....operation;
    .........;
} while (condition );

so, the compiler first performs the operations( inside the do...while loop block) then, it matches with the condition that whether the condition is TRUE/FALSE. Suppose, the condition is true, then it will again perform the operations inside the block with the updated value. But, if the first time also, the condition is false, it will not go again inside the block, but since it has already performed one time of the operations inside the block. We can say, do...while loop always perform the operation inside its block for at least one time.

(5)Answer: B. A break statement.

Explanation: The break statement exits out of the loop completely, and change the flow of the control to the first line after the loop.

Continue statement stops the current execution of the loop and proceeds to the next iteration with the updated value. i.e., continue statement change the flow of the control to the next updated value inside the loop only.

Return statement terminates the whole method. It stops executing the method and exit from the method execution with return value.

Add a comment
Know the answer?
Add Answer to:
java QUESTION 4 Which of the following statements about a do...while repetition statement is true? A....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT