answersLogoWhite

0


Best Answer

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

User Avatar

Wiki User

9y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

9y ago

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


This answer is:
User Avatar

User Avatar

Wiki User

11y ago

A do..while loop does not have an entry condition. The loop body will therefore execute at least once.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Which loop does not have an entry condition in C plus plus?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is the difference between entry and exit controlled loops - in Java?

while loop and for loop are entry controlled loops as they check looping condition at the entry point. do while loop is exit controlled loop as it checks looping condition at exit point. shreeradha@yahoo.com


Is for loop is faster than while loop in turbo c plus plus compiler?

No, why did you think so?


What r conditional loops and unconditional loops in c?

A conditional loop will only continue to loop while the given condition is true: while( i < 10 ) { ... } An unconditional loop either has no condition (a GOTO loop), or the condition is guaranteed to always evaluate to true: while( true ) { ... }


What is a do while statement in c plus plus?

A do-while statement is a type of loop that iterates while a condition remains true. The condition is evaluated at the end of each iteration, thus the statement always executes at least once. do { statement; } while (expression);


Definition of loop and its types and programs in c plus plus?

Executing a segment of a program repeatedly by introducing a counter and later testing it using the if statement.A sequence of statements are executed until some conditions for termination of the loop are satisfied.A Program loop consists of two segments:1.Body of the loop2. Control StatementDepending on the position of the control statement in the loop, a control strcture may be classifies either as the 2:Entry Controlled LoopExit Controlled Loop1.Entry Control Loop-(Pre Test Loop)The control conditions are tested before the start of the loop execution.If the conditions are not satisfied , then the body of the loop will not be executed.]eg:While Loop2.Exit Control Loop-(Post Test loop)The Test is performed at the end of the body of the loop and there fore the body is executed unconditionally for the first time.eg:Do-Whilewhile loopfor loopdo-while loop

Related questions

What are the entry condition loops in c plus plus?

An entry condition is a boolean expression (any expression that evaluates true or false) that is evaluated before each iteration of the loop executes. Although a for statement need not specify an entry condition, it is implied. Thus the following are all valid ways of defining an infinite loop: for (;;) {/*...*/} for (;true;) {/*...*/} while (true) {/*...*/} [Although the while (true) version is considered the most readable version, the for (;;) version is a well-established method of saying "for ever".] The do-while loop does not have an entry condition per-se because it always executes at least one iteration of the loop before evaluating the conditional expression. Thus the expression is an entry condition for the second and all subsequent iterations. The same can be said of a goto loop, but a goto loop need not specify an entry condition at all: again: /*...*/; goto again;


Which loop is also called an exit-condition loop in C programming?

The do while loop is also called an exit condition loop in c, c++, and java.


What is for looping in c language?

The for loop is another entry-controlled loop that provides a more concise loop control structure.The general form of the for loop isfor( initialization ; test condition ; increment ){body}Generally this loop is used when the either the no. of loops or the looping condition or the end condition is known.Ex.to count n no. of integers.Hope this will help.


What is the difference between entry and exit controlled loops - in Java?

while loop and for loop are entry controlled loops as they check looping condition at the entry point. do while loop is exit controlled loop as it checks looping condition at exit point. shreeradha@yahoo.com


Does 'for loop' works in C plus plus?

In C++, a for loop is structured as follows: for( int index = 0; index < 10; ++i ) { //do something }


Is for loop is faster than while loop in turbo c plus plus compiler?

No, why did you think so?


Example of flowchart of while loop in c plus plus?

kk


Which loop is most fastest in c plus plus?

In terms of performance there is no difference whatsoever. Which version you use is usually decided by which is more appropriate for the type of loop you want to execute. for() loops allow you to combine an initial condition, a conditional expression and a loop expression in a single statement. The initial condition can include a declaration which falls from scope when the loop ends, but all expressions are optional. If a conditional expression is not declared, a conditional expression must appear in the body of the loop. while() loops are similar to for() loops, but are generally used when an initial condition and loop expression are not required, but a condition is. The condition is non-optional. do..while() loops are used when a loop must execute at least once, and a condition is not optional.


What is CPU usage small programm c plus plus?

Example: int main (void) { LOOP: goto LOOP; }


C plus plus what do you do if im stuck in an infinite loop?

There are three ways out of a loop.1. Satisfy the loop ending condition2. Execute a break statement3. Terminate the programPerhaps you are not changing the value of the variable that is used in the loop ending condition. Perhaps you are using a variable, such as an unsigned int, decrementing it, and expecting it to go negative. Suggest you run the program in a debuger and step through the loop.


What is the difference between dowhile loop dountil?

A do-while loop checks its termination condition before each iteration, including the first; a do-until checks after each iteration, so that the first iteration occurs before the first check. The C language uses the word "while" for both types of loop, using the placement of the condition to control its timing:C do-while:while (condition) { /* condition checked before first loop iteration */... loop contents}C do-until:do {... loop contents} while (condition); /* condition not checked until after first loop iteration */


C plus plus for while loop example code?

The syntax for a for loop is:for (initialization; condition; increase) {statement;}for example:int arr[5] = {1, 2, 3, 4, 5};for (int i = 0; i < 5; i++) {cout