Factbites
 Where results make sense
About us   |   Why use us?   |   Reviews   |   PR   |   Contact us  

Topic: Do while loop


Related Topics

In the News (Sat 2 Jun 12)

  
  The DO-WHILE loop for C++
Having the test condition at the end, guarantees that the body of the loop always executes at least one time.
The body of the loop (the block of code) is enclosed in braces and indented for readability.
This means that the body of the loop is always executed first.
mathbits.com /MathBits/CompSci/looping/dowhile.htm   (176 words)

  
 PEP 315 -- Enhanced While Loop
This code is often duplicated outside the loop, as setup code that executes once before entering the loop: while : body> The problem is that duplicated code can be a source of errors if one instance is changed but the other is not.
In general, when the while suite is empty (a pass statement), the do-while loop and break and continue statements should match the semantics of do-while in other languages.
Likewise, when the do suite is empty, the do-while loop and break and continue statements should match behavior found in regular while loops.
www.python.org /dev/peps/pep-0315   (319 words)

  
 While loop - Wikipedia, the free encyclopedia
In most computer programming languages, a while loop is a control flow statement that allows code to be executed repeatedly based on a given boolean condition.
Because while loops check the condition before the block is executed, the control structure is often also known as a pre-test loop.
When such a loop is created intentionally, there is usually another control structure (such as a break statement) that controls termination of the loop.
en.wikipedia.org /wiki/While_loop   (522 words)

  
 The WHILE loop for C++
loop allows programs to repeat a statement or series of statements, over and over, as long as a certain test condition is true.
is called the body of the loop and is enclosed in braces and indented for readability.
If you want the loop to eventually terminate, something within the body of the loop must affect the test condition.
mathbits.com /MathBits/CompSci/looping/while.htm   (180 words)

  
 Do-while Loops   (Site not responding. Last check: 2007-10-13)
A do-while loop is a kind of loop, which is a kind of control statement.
It is a loop with the test at the bottom, rather than the more usual test at the top.
This kind of loop is most often used when the test doesn't make any sense until the statements have been performed at least once.
www.cis.upenn.edu /~matuszek/General/JavaSyntax/do-while-loops.html   (205 words)

  
 Do while loop - Wikipedia, the free encyclopedia
Because do while loops check the condition after the block is executed, the control structure is often also known as a post-test loop.
Contrast with the while loop, which tests the condition before the code within the block is executed.
When such a loop is created intentionally, there is usually another control structure (such as a break statement) that allows termination of the loop.
en.wikipedia.org /wiki/Do_while_loop   (514 words)

  
 While Loop Construct
A While Loop Construct repeatedly executes a group of statements, as long as a given condition is true.
If while executing the statements within the element, a Loop Continuation keyword is encountered, then the program flow skips the remaining statements and resumes just before the ending of the While Loop Construct.
In the following example, a While Loop Construct is shown that executes the statements in only if the original value of A is less than 100 and then repeats the execution of the statements in as long as the value of A remains less than 100.
www.oopic.com /while.htm   (359 words)

  
 Loop, Do While   (Site not responding. Last check: 2007-10-13)
The loop repeats as long as the Boolean expression becomes true.
Note that at least one of the statements in the body of the loop must change the value of the variables used in the Boolean expression if the loop is ever to terminate.
If you do that, your unsaved work will be lost, so it is a good idea to save programs before testing them.
som.csudh.edu /FAC/LPRESS/vb/doWhile.htm   (297 words)

  
 Trivial Do While Loop
A trivial do/while loop is a useful device in CeeLanguage consisting of a do/while loop with a loop condition which always fails; i.e:
It has to do with semicolons, and of course there are holy wars over whether languages should have them, but when you come right down to it, they're not that big of a deal; they're not one of the major reasons why C is flawed, even if one thinks they're a minor reason.
Sometimes one is doing guards, a long series of them, and if any fail, you don't want to do the final block of code.
c2.com /cgi/wiki?TrivialDoWhileLoop   (1900 words)

  
 ASP Do While Loop - Select....Case
Several instruction may be used within the loop.
In this example the condition is "mynumber=10", so mynumber will increased until it is equal to 10, and then the loop will be abandon.
In this example above, we have defined mynumber as 3, so they are executed the instructions following line 8 (in this case only one instruction is executed, but they may be several instructions).
www.virtualsplat.com /tips/do-loop-select-case.asp   (171 words)

  
 Mel Script - The do-while loop   (Site not responding. Last check: 2007-10-13)
A do while loop is a sentinal controlled repetition structure.
Unlike the while loop, the do-while loop will always execute at least once.
Doing the equivalent with a while loop would require at least two places in the code where the dialog was created....
www.robthebloke.org /mel/do_while_loop.html   (179 words)

  
 VBScript Looping Statements
The block of code is repeated while a condition is true or until a condition becomes true.
The code inside this loop will be executed as long as i is different from 10, and as long as i is greater than 10.
While using this site, you agree to have read and accepted our terms of use and privacy policy.
www.w3schools.com /vbscript/vbscript_looping.asp   (669 words)

  
 ZeusCMD - Design and Development Tutorials : C++ Programming Tutorials - Do-While Loop
You may have already noticed that the loop terminating condition is only checked at the end of the loop.
The while loop may not run if the logical expression is true whereas the do-while loop will always run at least once.
If it is possible that the loop may not run, you need to use the while loop.
www.zeuscmd.com /tutorials/cplusplus/16-DoWhileLoop.php   (319 words)

  
 converting a "do while loop" into a "For loop" - GIDForums
He recommended to me to use a "For loop" instead of the "do while loop" as it would look a lot more neat.
Well, as long as you get the loop to go through the same number of iterations in the for loop style as the while loop, the "blah blah blah" should remain the same.
Basically, the "blah, blah" portion is the body of the loop, which in your case IS the 'if' and 'else' conditions and their statements.
www.gidforums.com /t-9546.html   (1079 words)

  
 The do while Loop   (Site not responding. Last check: 2007-10-13)
This is very similar to the while loop except that the test occurs at the end of the loop body.
This guarantees that the loop is executed at least once before continuing.
The test then verifies the data, and loops back to read again if it was unacceptable.
www.its.strath.ac.uk /courses/c/subsection3_8_5.html   (92 words)

  
 DO-WHILE loop
The DO-WHILE loop evaluates the expression at the beginning of the loop and only enters and processes the statements within the loop if the expression is True.
It is in the expression that determines whether the DO-WHILE loop is processed or skipped.
Once in the loop, it is VERY IMPORTANT to make sure the condition in the expression can change.
oregonstate.edu /dept/statistics/sasclass/3-6dowhile.htm   (653 words)

  
 Do-While Loops
that is the condition in the while statement must be true for the loop block to execute.
For this scenario, we may want to use a do while loop, which is a post-condition loop.
Because the while condition fails the loop will not continue The condition is checked after the loop occured.
www.iit.edu /~paskron/html/TA/do-while_loops.html   (257 words)

  
 do-while loop   (Site not responding. Last check: 2007-10-13)
is smaller than prec, the loop replaces x1 by x2 and terminates.
To trap infinite loops, a count is kept of the number of iterations.
The loop also terminates if the count exceeds a specified count_limit.
www.ugrad.math.ubc.ca /Flat/ref-do.html   (136 words)

  
 While Loop - LabVIEW 7.1 Help - Support - National Instruments
If you select a While Loop on the Execution Control Express VIs and Structures palette and place it on the block diagram, a stop button also appears on the block diagram and is wired to the conditional terminal.
If you select a While Loop on the Structures palette and place it on the block diagram, a stop button does not appear.
After you create a While Loop, you can use shift registers to pass values from one iteration to the next.
zone.ni.com /reference/en-XX/help/lv/71/glang/While_Loop   (277 words)

  
 Do while loop - C Board   (Site not responding. Last check: 2007-10-13)
I realize that this is happening because once I enter data for a certain statement, I hit enter and that triggers the "Do while".
Once thats fixed, then I want to beable to do a validity check on the case of the letter or some other character that a user may enter.
I just want it to do a validity check to see if the user types in Y or N. If they type a 'y' or a 'n', it should execute the loop and tell the user that it did something wrong and to do it again.
cboard.cprogramming.com /showthread.php?t=9461   (1072 words)

  
 FIX: Loop Optimization Causes Infinite Do-While Loop
The use of loop optimization (/Ol, or /Ox for the C/C++ compiler 8.0 for Windows NT) in a do-while loop that terminates after a single iteration may cause an infinite loop.
An infinite loop is generated when the expression (i <= e) from the program below is true during the first loop iteration.
The optimized version will only reenter the loop if the two values are not equal, whereas the non-optimized version correctly checks if i is less than or equal to e.
support.microsoft.com /default.aspx?scid=kb;en-us;115704   (263 words)

  
 applying a do while loop to my program
But one other requirement is that I need to have it looped so that the user could continue as long as he likes.
for the loop criterion, i suggest using the concept of a flag, don't know if you learned the boolean stuff yet.
If you want to do something after the loop, then just do break; instead of return 0;, this way whatever you have after the loop will execute.
www.physicsforums.com /showthread.php?p=933580   (763 words)

  
 do-while loop problem... any suggestions? - Dev Shed
I have a question about do-while loops, it might sound easy to some of you, but i have just started programming and cant get this thing to work...
Place that inside a while loop that loops while the boolean variable quit is false.
Then when q is pressed and quit becomes true the program will exit the while loop.
forums.devshed.com /java-help-9/do-while-loop-problem-any-suggestions-298297.html   (1101 words)

  
 do-while loop - Code Forums
I was just doing some basic looping in C++ and I can't seem to compile this program.
Exit the program " << endl; selectop = 1; do { switch(selectop) { case 1: cout << "My name is Menish Sharma " << endl; break; case 2: cout << "Unfortunately, I don't have a brother or sister.
This is due to the fact that <= says 'while it is less than or equal to 6, it is true." However, as your 'exit' happens ON six, you have to have 6 be an exit condition, so your loop should be something like:
codenewbie.com /forum/standard-c-c/1263-do-while-loop.html   (455 words)

  
 do-while Loop   (Site not responding. Last check: 2007-10-13)
To repeat a block of code while a condition is true.
structure tests the after the loop body is performed, therefore the loop body is executed at least once.
When the is false, the loop terminates and execution continues with the statement after the
www.cs.brown.edu /courses/cs015/ref/javarefguide/do.html   (81 words)

  
 do while loop freezes - kirupaForum
Note: this loop is already in another for-loop, so maybe it's just too much looping...
Now it loops through the array until it finds a number in the array that corresponds with randomNum or the loop ends.
If it finds a match randomCheck variable is set to true, putting the do-while loop in a deadlock as there is nothing that sets randomCheck to false again.
www.kirupa.com /forum/showthread.php?t=204986   (323 words)

  
 do-while loop Comparison Table   (Site not responding. Last check: 2007-10-13)
syntactic unit > statement > control flow statement > loop statement > do-while loop
Next loop statement: for loop Up: loop statement Previous loop statement: while loop
//statements to keep executing while boolean expression is true
www.site.uottawa.ca:4321 /java/do-whileloop_table.html   (57 words)

  
 Problem with do-while loop
Do not implement the subtraction, multiplication, or division.
Use a 'do while' loop, as shown below.
Here is pseudocode of what should go in the do loop for this exercise:
www.daniweb.com /techtalkforums/thread60236.html   (520 words)

  
 Tryit Editor v1.4   (Site not responding. Last check: 2007-10-13)
i will increase by 1 each time the loop runs.
While i is less than, or equal to, 5, the loop will continue to run.
Edit the text above, and click on the button to see the result.
www.w3schools.com /js/tryit.asp?filename=tryjs_dowhile   (38 words)

Try your search on: Qwika (all wikis)

Factbites
  About us   |   Why use us?   |   Reviews   |   Press   |   Contact us  
Copyright © 2005-2007 www.factbites.com Usage implies agreement with terms.