Top "While-loop" questions

A while loop is a control structure used in many programming languages to continuously execute a set of instructions as long as a particular condition is met.

How can you run a command in bash over until success

I have a script and want to ask the user for some information, the script cannot continue until the user …

bash command while-loop
For vs. while in C programming?

There are three loops in C: for, while, and do-while. What's the difference between them? For example, it seems nearly …

c loops for-loop while-loop
How to break a while loop from an if condition inside the while loop?

I want to break a while loop of the format below which has an if statement. If that if statement …

java if-statement while-loop break
How to write a simple Java program that finds the greatest common divisor between two numbers?

Here is the question: "Write a method named gcd that accepts two integers as parameters and returns the greatest common …

java loops while-loop greatest-common-divisor
While, Do While, For loops in Assembly Language (emu8086)

I want to convert simple loops in high-level languages into assembly language (for emu8086) say, I have this code: for(…

loops for-loop assembly while-loop x86-16
Bash scripting, multiple conditions in while loop

I'm trying to get a simple while loop working in bash that uses two conditions, but after trying many different …

bash shell loops while-loop
mysqli_fetch_array while loop columns

Should be pretty basic, but I can't get it to work. I have this code to iterate over a mysqli …

php mysqli while-loop multiple-columns
Are loops really faster in reverse?

I've heard this quite a few times. Are JavaScript loops really faster when counting backward? If so, why? I've seen …

javascript optimization loops for-loop while-loop
'do...while' vs. 'while'

Possible Duplicates: While vs. Do While When should I use do-while instead of while loops? I've been programming for a …

c# c++ c while-loop do-while
Which loop is faster, while or for?

You can get the same output with for and while loops: While: $i = 0; while ($i <= 10){ print $i."\n"; $i++; }; …

performance for-loop while-loop