From be54a105c5f7d12111af3aeb3043ec21ba057d9c Mon Sep 17 00:00:00 2001 From: Louis Date: Thu, 5 Oct 2023 16:25:30 +0200 Subject: [PATCH] vault backup: 2023-10-05 16:25:30 --- Prog/Loops.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Prog/Loops.md b/Prog/Loops.md index 32b1ed3..d72f255 100644 --- a/Prog/Loops.md +++ b/Prog/Loops.md @@ -3,7 +3,8 @@ In C#, loops are called iteration statements. We need to master both, recursion - for - foreach > For the rest of the document, something between `<>`is something mandatory and something between `[]`is something optionnal -## While loop +## Iteration statements +### While loop ```cs while () { @@ -24,7 +25,7 @@ unit SumWhile(unit n) return loop; } ``` -### Iteration statements - do (..) while +#### Iteration statements - do (..) while ```cs do { @@ -46,7 +47,7 @@ uint SumDoWhile(uint n) } ``` -## For loop +### For loop ```cs for ([initialize]; [condition]; [iterator]) { @@ -99,10 +100,8 @@ foreach (char c in test) ## Jump statements Jump statements is something that can change the behaviour of a loop inside itself. -It's possible to change the behaviour of the loops using the following keyworkds: +It's possible to change the behaviour of the loops using the following keywords: - ``break`` - ``continue`` - ``return`` -> ⚠️ It's not a good idea to use them, but rather to rework your loop correctly instead - -### Jump statements - break \ No newline at end of file +> ⚠️ It's not a good idea to use them, but rather to rework your loop correctly instead \ No newline at end of file