From 2a55e44449698abc11a55ca52e66e4ad128dc8a2 Mon Sep 17 00:00:00 2001 From: Louis Date: Thu, 5 Oct 2023 09:39:49 +0200 Subject: [PATCH] vault backup: 2023-10-05 09:39:49 --- Prog/Loops.md | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/Prog/Loops.md b/Prog/Loops.md index 7a978ba..d7c2a08 100644 --- a/Prog/Loops.md +++ b/Prog/Loops.md @@ -78,4 +78,29 @@ while ([condition]) // Repeat stuff [iterator] } -``` \ No newline at end of file +``` + +**We can also doo like the while loop** +```cs +for ( ; [condition] ; ) +{ + // repeat stuff +} +``` + +## Foreach loop +```cs +string test = "ABCD"; +foreach (char c in test) +{ + Console.WriteLine(c); +} +``` + +## 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: +- ``break`` +- ``continue`` +- ``return`` +- \ No newline at end of file