4.Lesson 3: Control Statements - Selection

In the last couple of lessons, every program you saw contained a limited amount of sequential steps and then stopped. There were no decisions you could make with the input and the only constraint was to follow straight through to the end. The information in this lesson will help you branch into separate logical sequences based on decisions you make. More specifically, the goals of this lesson are as follows:

  • Learn the if statements.
  • Learn the switch statement.
  • Learn how break is used in switch statements.
  • Understand proper use of the goto statement.
Yes No Suggest edit
Suggest Edit