English
Topic 3. Control flow: branching and loops
Goal: become familiar with C# selection and iteration statements; learn to use if, switch, switch expressions with patterns, and while, do/while, for, and foreach loops; master jump statements and common algorithms: accumulation, searching, repeated input prompts, and approximate calculations with a specified accuracy.
Lecture contents
- Blocks and the conditional statement — Code blocks and scope · The if statement · The ternary operator ?:
- switch and patterns — The switch statement · Patterns · The switch expression
- Loops — while and do/while loops · The for loop · The foreach loop
- Jump statements and common algorithms — Jump statements · Common loop algorithms
- Examples and common mistakes — Example programs · Common mistakes