Back to C Programming

Control Flow

Direct the flow of your program's execution using conditional statements (if, switch) and loops (for, while, do-while).

2 weeks

Topics in this Chapter

1

if, else-if, else

Make decisions in your code by executing blocks based on one or more conditions.

2

switch Statement

Select one of many code blocks to be executed based on the value of a single variable.

3

for Loop

Execute a block of code a specific number of times using the compact `for` loop syntax.

4

while & do-while Loops

Repeat a block of code as long as a condition is true, using `while` and `do-while` loops.

5

break & continue

Alter the normal execution flow of loops using `break` to exit and `continue` to skip an iteration.

6

goto Statement

Understand the `goto` statement for unconditional jumps, its usage, and why it's often discouraged.

GeekDost - Roadmaps & Snippets for Developers