Step Into C · Lesson 4 · Control Flow
Making Decisions
Reading input, if / else, truthiness, switch and the ternary operator.
- ~25 minreading and coding
- 4missions
- membersaccess
- Clanguage
Part of Step Into C. The full lesson, its missions and the real compiler and debugger are in the course. Try a free lesson first to see how it works.
Programs get more interesting when they react to input. scanf reads formatted input from stdin (standard input). In this IDE, stdin is the Input tab of the console.
In this lesson
- Reading a number from input
- if / else
- Truthiness: zero is false
- Combining conditions
- switch
- The ternary operator
- Blocks and scope
Missions
- Even or odd
- Sign of a number
- Switch it up
- The ternary