FIND YOUR NEXT FEW LINES

Results for “loop”

Small, practical examples. Search by task or narrow things down below.

56 snippets foundClear filters
C++Getting Started

Repeat a fixed number of times

C++: Use a counted loop to print three numbered steps.

C++✓ Tested
CGetting Started

Repeat a fixed number of times

C: Use a counted loop to print three numbered steps.

C✓ Tested
Arduino / CTiming & control

Repeat an action a fixed number of times

Use a counter and delay for a simple finite sequence.

for loop✓ Tested
PythonGetting Started

Repeat while a condition holds

Python: Count down while a positive number remains, updating the loop variable on each iteration.

Python✓ Tested
C#Getting Started

Repeat while a condition holds

C#: Count down while a positive number remains, updating the loop variable on each iteration.

C#✓ Tested
JavaGetting Started

Repeat while a condition holds

Java: Count down while a positive number remains, updating the loop variable on each iteration.

Java✓ Tested
JavaScriptGetting Started

Repeat while a condition holds

JavaScript: Count down while a positive number remains, updating the loop variable on each iteration.

JavaScript✓ Tested
TypeScriptGetting Started

Repeat while a condition holds

TypeScript: Count down while a positive number remains, updating the loop variable on each iteration.

TypeScript✓ Tested
C++Getting Started

Repeat while a condition holds

C++: Count down while a positive number remains, updating the loop variable on each iteration.

C++✓ Tested
CGetting Started

Repeat while a condition holds

C: Count down while a positive number remains, updating the loop variable on each iteration.

C✓ Tested
Bash ScriptsLoops & decisions

Sum a range of integers

Use an arithmetic loop without launching external processes.

arithmetic✓ Tested
Arduino / CGetting Started

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