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.

Is using a while block to do nothing a bad thing?

I'm currently working through the excercises in 'The C Programming Language'. Here's one of my solutions: int c; while ((c=…

c while-loop
Post Increment in while loop in C

Here is a very simple C program: int main() { int i = 0; while(i++ < 10) printf("%d\n", i); return 0; } The …

c while-loop post-increment pre-increment
How do you loop through a multiline string in Ruby?

Pretty simple question from a first-time Ruby programmer. How do you loop through a slab of text in Ruby? Everytime …

ruby string while-loop loops
FPDF Page Break Question

I am using PHP and FPDF to generate a PDF with a list of items. My problem is if the …

pdf while-loop fpdf page-break
While loops using Await Async.

This Javascript function seems to use the while loop in an asynchronous way. Is it the correct way to use …

loops asynchronous while-loop async-await ecmascript-next
Which is faster in SQL, While loop, Recursive Stored proc, or Cursor?

Which is faster in SQL, While loop, Recursive Stored proc, or Cursor? I want to optimize the performance in a …

sql-server performance stored-procedures while-loop cursor
Using FOR loop in VHDL with a variable

Is there any possible way to create a for loop in the form: for i in 0 to some_var loop // …

loops for-loop while-loop vhdl synthesize
JavaScript while mousedown

var mdflag; var count = 0; document.addEventListener("mousedown",mdown,false); document.addEventListener("mouseup",mup,false); } function mdown() { mdflag=true; while(mdflag) …

javascript while-loop mousedown
How to implement a do-while loop in tsql

I'm trying to figure how to implement this in TSQL do update stuff set col = 'blah' where that_row = 'the …

sql sql-server tsql while-loop control-flow
Counting digits using while loop

I was recently making a program which needed to check the number of digits in a number inputted by the …

c++ while-loop digits counting