Question

for c++ Suppose cond1 is a Boolean expressions. When will this while condition be true? while...

for c++

Suppose cond1 is a Boolean expressions. When will this while condition be true?
while (cond1) ...

always false
always true
in case cond1 is false
in case cond1 is true
0 0
Add a comment Improve this question Transcribed image text
Answer #1

d) in case cond1 is true

Explanation:

A while loop statement repeatedly executes a target statement as long as a given condition is true.

Syntax

The syntax of a while loop in C++ is −

while(condition) {
   statement(s);
}

Here, statement(s) may be a single statement or a block of statements. The condition may be any expression, and true if any non-zero value. The loop iterates while the condition is true.

When the condition becomes false, program control passes to the line immediately following the loop.

In this case, the while condition will be true only when cond1 is true.

Add a comment
Know the answer?
Add Answer to:
for c++ Suppose cond1 is a Boolean expressions. When will this while condition be true? while...
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