Practice It: C Decisions and Loops
1h 21mIntermediate2023-04-13
Authors

Dan Gookin
Creator, Teacher, and Technology Writer with 20+ years of experience
Course details
What makes programming different from a list of instructions? Decisions and loops. Decisions allow programs to do different things based on changing conditions. A loop expands upon this notion by allowing chunks of code to repeat based on conditions. Knowing how decisions and loops work is vital to your programming career, and in this course, Dan Gookin provides a series of C programming challenges to help you learn and practice these key areas of knowledge. The purpose of these challenges is not simply to solve the given puzzle, but to explore alternative ways to accomplish the same task—to modify the code and discover through trial and error how things work. Rather than just repeating rote exercises, the goal is to gain insight into the computing process and motivate you to explore further and expand your knowledge through experience. If you’re a C programmer looking for a deeper understanding of these important, core concepts, join Dan in this course.
Skills covered
CProgramming LanguagesOpen SourceSoftware DevelopmentOne-Off
Concepts
0. Introduction
- 01 - The core of programming
- 02 - System setup and configuration
1. Decisions
- 03 - Choosing this or that
- 04 - Try it - Checking the temperature
- 05 - Check it - Checking the temperature
- 06 - Try it - Plotting a robot's path
- 07 - Check it - Plotting a robot's path
- 08 - Try it - Detecting the operating system
- 09 - Check it - Detecting the operating system
- 10 - Using a switch-case structure
- 11 - Try it - Processing a menu
- 12 - Check it - Processing a menu
- 13 - Try it - Drawing a random card
- 14 - Check it - Drawing a random card
- 15 - Working the ternary operator
- 16 - Try it - Finding the high score
- 17 - Check it - Finding the high score
- 18 - Check it - Knowing odd or even
2. Loops
- 19 - Repeating a chunk of code
- 20 - Try it - Calculating a harmonic series
- 21 - Check it - Calculating a harmonic series
- 22 - Using a for loop
- 23 - Try it - Reviewing high scores
- 24 - Check it - Reviewing high scores
- 25 - Try it - Counting the Mondays
- 26 - Check it - Counting the Mondays
- 27 - Try it - Generating a table
- 28 - Check it - Generating a table
- 29 - Check it - Crafting a bubble sort
- 30 - Try it - Counting in two directions
- 31 - Check it - Counting in two directions
- 32 - Discovering the do-while loop
- 33 - Try it - Processing text input
- 34 - Check it - Processing text input
Conclusion
- 35 - Next steps