answersLogoWhite

0

What happens in the second loop?

Updated: 12/22/2022
User Avatar

Wiki User

7y ago

Want this question answered?

Be notified when an answer is posted

Add your answer:

Earn +20 pts
Q: What happens in the second loop?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What happens if the controlling expression in a do while loop is initially false?

The do-while loop is designed specifically for such situations, where you want the loop to execute once irrespective of the loop expression. The loop would execute once and then terminate because, the loop controlling expression is false. If you note the syntax properly do { ... ... ... } while(condition) The condition is executed only after one iteration of the loop and hence the code would execute once irrespective of the loop expression result.


How to write a program to show the counter that counts 1000000 in a second?

You need to know how long a loop of 1000000 takes to execute. If it executes in an appropriate fraction of a second, you can provide a sub-loop or no-op instructions to make up the difference. If it does not, you can not.


Which loop does not have an entry condition in C plus plus?

The only loop that does not require an entry condition is the procedural goto loop: again: /*...*/ goto again; Although a do-while loop has no entry condition per-se, it still requires a mandatory entry condition into the second and all subsequent iterations. do { /*...*/} while (true); // mandatory entry condition into all but the 1st iteration And although a for loop's condition is optional, it is implicit: for (;;) {/*..*/} // implicit for ever loop for (;true;) {/*...*/} // explicit for ever loop


Is a for loop a post-test loop?

Yes. The second clause (the condition) is evaluated before each iteration through a loop. It is possible that a for loop will not execute if its precondition is not met. For example, "for( int x = 5; x < 5; x++ )" will not iterate even once.


When loops are nested does one loop have to end before the other begins?

If one loop ends before the next begins then they are not nested at all -- they are completely independent. To be nested, one loop must contain the other loop in its entirety. That is, the inner, nested loop must start and end within the outer, containing loop. Nested loop example (in C++): for( int x = 0; x < 10; ++x ) // outer loop { for( int y = 0; y < 10; ++y ) // inner loop (nested loop) { printf( "%d x %d = %d\r\n", x, y, x*y ); } // end of inner loop } // end of outer loop

Related questions

How is the first loop in the circulatory system of an adult amphibian different from the second loop?

Tadpole has two chambered heart and a single-loop system while the adult has a three chambered heart and a double-loop system


What is a convection loop?

basically the scientific fact that heat rises and cold temperatures sink. A convection loop happens in air and water.


What happens to filtered blood after it leaves the nephron?

Glomerular filterate goes into the bowmans capsule then gets transported along the first convuluted tubule, then descending part of thr loop of henle, then the ascending part of the loop of henle, then the second convuluted tubule, then into the collecting duct and onwards to the ureters, then into the bladder and out through the urethra and into the specimen pot for your illegal drug tests.nephron loop


What happens if a gerbils eats Fruit Loop cereal?

it gets fed.


What happens in loop one and two of the heart?

blah blah blah


What is the pattern of blood flow through the 2 loops of the body?

the first loop is lungs to the heart. the second loop is body to the heart.


What is the equivalence of for and while loops?

The For loops and While loops are similar in functionality aspects. They perform a specified set of instructions repeatedly until a certain condition is met. The only difference being, the loop variable modification happens in the for loop declaration whereas in case of a while loop, we must include it in the block of code within the loop. Ex: For Loop: for(int i=0; i<10;i++){ ... } While Loop: int i = 0; while(i < 10){ i++ ... } If you see the code the variable initialization, modification happens in the same line for a For loop whereas in case of a while loop we do it in separate lines of code.


What happens when there is a change in the magnetic field in a closed loop of wire?

It produces a current.


What happens if the controlling expression in a do while loop is initially false?

The do-while loop is designed specifically for such situations, where you want the loop to execute once irrespective of the loop expression. The loop would execute once and then terminate because, the loop controlling expression is false. If you note the syntax properly do { ... ... ... } while(condition) The condition is executed only after one iteration of the loop and hence the code would execute once irrespective of the loop expression result.


State the kirchafs second law?

Kirchaf's second law states that the direct sum of the voltage in a loop is zero.


What happens second in Climate change?

What happens second in Climate change


How to write a program to show the counter that counts 1000000 in a second?

You need to know how long a loop of 1000000 takes to execute. If it executes in an appropriate fraction of a second, you can provide a sub-loop or no-op instructions to make up the difference. If it does not, you can not.