Module 05 of 11

Control Flow & Loops

Lessons

About This Module

Up to now, your programs have run top to bottom, one line after another. Control flow is what lets a program make decisions and repeat work, which is where it starts to feel like real software.

The module begins with conditional statements: if, else if, and else, then the switch statement for choosing between many cases. It moves on to loops, covering while, do-while, and for, and finishes by putting loops and conditions together in a small guessing game.

Watch the lessons in order, then continue on to Functions & Scope.

Lessons

5 videos
01

Conditional Statements: if, else if, else

C Programming Tutorial 4: how to make a program choose between paths using if, else if, and else.

02

The switch Statement

Programiz's lesson on the switch statement and break, including switch with multiple cases and a simple calculator example.

03

While Loops

C Programming Tutorial 5: using a while loop to run code repeatedly until a condition changes.

04

For, While & Do-While Loops

A walkthrough of the three loop types in C, with examples of each, so you can pick the right one for the job.

05

Building a Guessing Game

The freeCodeCamp chapter that combines loops and conditionals into a number guessing game. Starts at the 2:37:48 mark.