Results for “loop”
Small, practical examples. Search by task or narrow things down below.
Repeat a fixed number of times
C++: Use a counted loop to print three numbered steps.
C++✓ Tested
Repeat a fixed number of times
C: Use a counted loop to print three numbered steps.
C✓ Tested
Repeat an action a fixed number of times
Use a counter and delay for a simple finite sequence.
for loop✓ Tested
Repeat while a condition holds
Python: Count down while a positive number remains, updating the loop variable on each iteration.
Python✓ Tested
Repeat while a condition holds
C#: Count down while a positive number remains, updating the loop variable on each iteration.
C#✓ Tested
Repeat while a condition holds
Java: Count down while a positive number remains, updating the loop variable on each iteration.
Java✓ Tested
Repeat while a condition holds
JavaScript: Count down while a positive number remains, updating the loop variable on each iteration.
JavaScript✓ Tested
Repeat while a condition holds
TypeScript: Count down while a positive number remains, updating the loop variable on each iteration.
TypeScript✓ Tested
Repeat while a condition holds
C++: Count down while a positive number remains, updating the loop variable on each iteration.
C++✓ Tested
Repeat while a condition holds
C: Count down while a positive number remains, updating the loop variable on each iteration.
C✓ Tested
Sum a range of integers
Use an arithmetic loop without launching external processes.
arithmetic✓ Tested
Visit every reading in a fixed array
Arduino / C: Visit every reading in a fixed array on an Uno with the Serial Monitor set to 9600 baud.
Arduino / C✓ Tested