Question

Which statement is generally false? a. Statements preceding a for and statements in the body of...

Which statement is generally false?

a. Statements preceding a for and statements in the body of a for should typically be merged into the for header.

b. Limit the size of control statement headers to a single line, if possible.

c. Initialization of a for loop control variable can occur before the for loop executes and not in the loop itself.

d. The increment portion of a for header can be a decrement.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer:       (a)   Statements preceding a for and statements in the body of a for should typically be merged into the for header.


Reason:       Statements in the body of for can never be merged into the for the header. The body of the for is enclosed within {} and can be not written somewhere else.

Also,       (b)   Limit the size of control statement headers to a single line, if possible.
           It is possible, this is why for loop can be implemented in a single line.

       (c)   Initialization of a for loop control variable can occur before the for loop executes and not in the loop itself.
           It is also true, loop variable can be initialized before the loop starts.

       (d)   The increment portion of a for header can be a decrement.
           It is also true, by changing the update expression in a loop.

Add a comment
Know the answer?
Add Answer to:
Which statement is generally false? a. Statements preceding a for and statements in the body of...
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
  • QUESTION 1 Which statement results in the value false? The value of count is 0; limit...

    QUESTION 1 Which statement results in the value false? The value of count is 0; limit is 10. (count != 0)&&(limit < 20) (count == 0)&&(limit < 20) (count != 0)||(limit < 20) (count == 0)&&(limit < 20) 10 points    QUESTION 2 If this code fragment were executed in an otherwise correct and complete program, what would the output be? int a = 3, b = 2, c = 5 if (a > b) a = 4; if (...

  • 15. Which one of the following two conditional statements is correct in determining if m falls...

    15. Which one of the following two conditional statements is correct in determining if m falls outside a range of values, (m <= 0) or (m > n)? Circle one answer: (a) if(m <0||m >n) (b) if(m <= 0 && m >n) (c) if(0 <= m || m <n) (b) if (0 <= m && m <n) 16. The statement (or command or function) is used inside a loop to send control of the program to the last line of...

  • Form B 29. Which of the following statements about the continue statement is true a. The...

    Form B 29. Which of the following statements about the continue statement is true a. The continue statement is used to exit a repetition structure early and continue the execution of the statements following the loop. b. The continue statement is used to continue after a switch statement c. The continue statement does not alter the flow of control d. A continue statement proceeds with the next iteration of the immediately enclosing loop. e. None of the above 30. Inside...

  • java QUESTION 4 Which of the following statements about a do...while repetition statement is true? A....

    java QUESTION 4 Which of the following statements about a do...while repetition statement is true? A. The body of a do...while loop is executed only if the terminating condition is true. B. The body of a do...while loop is executed only once. C. The body of a do...while loop is always executed at least once. D. None of the above QUESTION 5 To exit out of a loop completely and change the flow of control to the first line after...

  • Which of the following statements is NOT correct concerning the Manufacturing Overhead Budget? Multiple Choice The...

    Which of the following statements is NOT correct concerning the Manufacturing Overhead Budget? Multiple Choice The Manufacturing Overhead Budget provides a schedule of all costs of production other than direct materials and labor costs. The Manufacturing Overhead Budget shows only the variable portion of manufacturing overhead. The Manufacturing Overhead Budget shows the expected cash disbursements for manufacturing overhead. The Manufacturing Overhead Budget is prepared after the Sales Budget. The basic idea underlying responsibility accounting is that a manager should be...

  • Each of the following statements is either true, or false. For each statement below state which...

    Each of the following statements is either true, or false. For each statement below state which each is true or false, and briefly but precisely explain your answer. 1. When the rate of output is at the socially efficient level, the total social benefit is as large as possible. 2. A polluter will buy a permit if the price is less than its marginal abatement cost (MAC) of controlling emissions. 3. The Coase theorem states that social efficiency can be...

  • Question 1 (4 points) ✓ Saved Which of the following statements is true? Bitcoin is a...

    Question 1 (4 points) ✓ Saved Which of the following statements is true? Bitcoin is a distributed and decentralized ledger that records and verifies transactions and ownership, and makes it difficult to tamper with, or shut down. Blockchain is a digital asset where a secure form of cryptography is used to handle transactions, control the creation of additional units, and verify the transfer of assets. There is no single blockchain software used by all -- e.g., Bitcoin has its own...

  • Question{04}: Which statement is true about "if" and "switch" statements? A. they can be used to...

    Question{04}: Which statement is true about "if" and "switch" statements? A. they can be used to control the flow of your code B. they can use combinations of logicals in their expression C. in some situations, they can be used interchangeably D. they can be used to selectively run lines of code based on a condition or expression E. all of the above Answer{04}=''; Reason{04}=''; Question{05}: Which statement is true about the "else" and "otherwise" A. an "else" is not...

  • say if its true ir false Indicate the True (1) or False statement in the following...

    say if its true ir false Indicate the True (1) or False statement in the following 1. ( The vernier scale (on the smaller moving portion of the caliper) gives the most significant digits in the reading 2. ) Abbe's principle states that the minimum accuracy may obtain when the standard scale and the work piece being measured are aligned on the same line measurement 3. (' ) Thermocouples can be made smaller in size than most RTD's so they...

  • NAME SID__ 31. Which of the following is a correct statement when comparing Open Circulatory Systems...

    NAME SID__ 31. Which of the following is a correct statement when comparing Open Circulatory Systems and Closed Circulatory Systems? a. Open Circulatory Systems generally require MORE energy to operate, since it is less efficient to circulate the entire amount of interstitial fluid in the body cavity. 8. Arthropods and Insects generally use a Closed Circulatory System, while vertebrates generally use an Open Circulatory System Both systems utilize some form of the following three components: (1) circulatory fluid, (2) vessels...

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