Question

In: Computer Science

Choose the correct option to match the command descriptions below: The ..(1).. command passes control to...

Choose the correct option to match the command descriptions below:

The ..(1).. command passes control to the next iteration of a for or while loop, 
and skips any remaining statements in the body of the loop for the current iteration.
 
The ..(2).. command terminates execution of for or while loops. Statements in the loop that appear after 
this command are not executed.
 
 

(1)end

(2) continue

(1) continue

(2) terminate

(1) continue
(2) break

(1) break
(2) terminate

(1) break

(2) continue

Solutions

Expert Solution

​​​​​​The continue  command passes control to the next iteration of a for or while loop, and skips any remaining statements in the body of the loop for the current iteration.

Explanation :

A continue command skips or jumps the current iteration and goes to the next iteration in a for or while loop.

For example consider , following example

for(i=1; i<=5; i++)

{

if(i == 3) /* when i=3 then we skip it */

{

continue;   

}

printf("%d ", i);

}

The Output will be : 1 2 4 5

3 gets missed in Output as we kept continue.

The break command terminates execution of for or while loops. Statements in the loop that appear after this command are not executed.

Explanation :

A break is used to come out of loop or break out of any loop it may be for or while.

For example:

i = 1

while ( i < = 5)

{

if ( i == 4)   /* when i=4 then we exit the current loop */

{

break;

}

printf("%d ", i);

i = i + 1;

}

Output will be : 1 2 3

4 5 will not be printed because we exit the loop when we arrive at 4


Related Solutions

Match the descriptions below with the correct answer, using the letter codes shown in the table...
Match the descriptions below with the correct answer, using the letter codes shown in the table below. (8 points) A.    Realizable value B.    Percentage of receivables method C.      1/10, n/60 D.    Bad debt Expense E.      Aging of receivables F.       Direct write-off method G.     Operating cycle H.     Specific identification method I.        FOB shipping point J.        Time period assumption K.    n/10 EOM L.    Percentage of sales method M.   Permanent accounts N.    2/10, EOM O.    2/10, n/30 P.     FOB destination The economic life...
Please match the correct definitions withe the correct terms. Part A Descriptions Terms This base, or...
Please match the correct definitions withe the correct terms. Part A Descriptions Terms This base, or foundational, interest rate is the rate that banks charge on large loans to their most creditworthy business borrowers; rates charged to other, riskier, customers are scaled up from this rate. Accruals    A legal claim against a borrowing firm’s entire inventory created to secure a loan in which the borrower retains control over the inventory and can sell items without the lender’s permission. Blanket...
Match the following descriptions to the correct branch of the nervous system. Answers may be used...
Match the following descriptions to the correct branch of the nervous system. Answers may be used once, more than once, or not at all. Use A = Sympathetic and B = Parasympathetic * Exercise *Increases production of stomach acid *Orgasm in women * Glycogenolysis * Decreases urine production * Diaphoresis * Increases insulin release
CHOOSE THE CORRECT ANSWER AND EXPLAIN FOR EACH OPTION WHY YOU DID NOT CHOOSE THAT OPTION....
CHOOSE THE CORRECT ANSWER AND EXPLAIN FOR EACH OPTION WHY YOU DID NOT CHOOSE THAT OPTION. Arrange the following events in steroid function in chronological order. Number each statement from 1-5. _____Level of estradiol increases _____Decrease in the thickening of uterine lining _____Ovulation triggered by luteinizing hormone _____If no ovum is fertilized, progesterone and estradiol production stops _____Bleeding due to sloughed off uterine lining a. 3, 2, 4, 1, 5 b. 3, 1, 4, 2, 5 c. 1, 4, 3,...
Match each of the following descriptions with the correct cranial nerve. Each question will only have...
Match each of the following descriptions with the correct cranial nerve. Each question will only have 1 ANSWER. Answers may be used once, more than once, or not at all. a. Olfactory (I) b. Optic (II) c. Oculomotor (III) d. Trochlear (IV) e. Trigeminal (V) ab. Abducens (VI) ac. Facial (VII) ad. Vestibulocochlear (VIII) ae. Glossopharyngeal (IX) bc. Vagus (X) bd. Accessory (XI) be. Hypoglossal * Damage to this nerve might make you feel dizzy and nauseous * Smoking, cocaine...
For each of the descriptions of reactions, i – iv, directly below, match one of the...
For each of the descriptions of reactions, i – iv, directly below, match one of the statements, A – D. Put the appropriate letter A, B, C or D in the blank provided in front of each reaction description, i – iv. i) ____ An endothermic reaction in which the products have less entropy than the reactants ii) ____ An endothermic reaction in which the products have more entropy than the reactants iii) ____ An exothermic reaction in which the...
QUESTION Match the following molecular biology techniques to their correct descriptions. Restriction Enzyme    Gel Electrophoresis...
QUESTION Match the following molecular biology techniques to their correct descriptions. Restriction Enzyme    Gel Electrophoresis Polymerase Chain Reaction . Sanger Sequencing Gene Cloning A. Technique for separating charged molecules on the basis of molecular size or charge, or both. B. An enzyme that cuts double-stranded DNA at a specific sequence. C. Method of amplifying DNA fragments quickly in the test tube. D. A technique that makes many identical copies of a piece of DNA, by inserting the target DNA...
Match the descriptions that follow with the corresponding terms. Terms Descriptions 1. Activity-Based CostingBalanced ScorecardTotal Quality...
Match the descriptions that follow with the corresponding terms. Terms Descriptions 1. Activity-Based CostingBalanced ScorecardTotal Quality Management (TQM)Research and Development, and Product DesignService IndustriesJust-In-Time (JIT) InventorySarbanes-Oxley Act (SOX)Global Reporting Initiative Inventory system in which goods are manufactured or purchased just as they are needed for sale. 2. Activity-Based CostingBalanced ScorecardTotal Quality Management (TQM)Research and Development, and Product DesignService IndustriesJust-In-Time (JIT) InventorySarbanes-Oxley Act (SOX)Global Reporting Initiative A method of allocating overhead based on each product’s use of activities in making the...
Match the letter description listed below with the correct information characteristic listed numbers below. 1. Access...
Match the letter description listed below with the correct information characteristic listed numbers below. 1. Access restricted ___2. Accurate ___3. Available ___4. Reputable ___5. Complete ___6. Concise ___7. Consistent ___8. Current ___9. Objective ___ 10. Relevant ___ 11. Timely ___ 12. Useable ___ 13. Understandable ___ 14. Verifiable ____ a. A report was carefully designed so that its data was easily comprehended by the reader. b. A manager working on the weekend needed information about a customer’s production requests and...
Which of the descriptions below is an example of resonant energy transfer? (Choose all that are...
Which of the descriptions below is an example of resonant energy transfer? (Choose all that are correct.) View Available Hint(s) Hint 1. opened hint Review natural frequency and resonance. Which of the descriptions below is an example of resonant energy transfer? (Choose all that are correct.) A block sliding on a horizontal surface slows down and comes to a stop due to the friction force. Soldiers marching in unison on a bridge with their steps at a frequency that is...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT