What are sequence, iteration and branching?

Programmers write algorithms to instruct computer to perform a particular task. An algorithm is a step-by-step set of instructions that is designed to provide a solution to a particular problem.

Algorithms can be written in any computer programming language. Programmers also write algorithms in plain English while they’re figuring out the correct solution. This is called pseudocode.

There are three basic techniques:

  • Sequence – This just means that you write the code in the order by which it should be executed.
  • Branching (or Selection) - This is an algorithm where the code to execute next is determined by a a Boolean expression. This means that sometimes we branch to a particular statement skipping over others.
  • Iteration - Many algorithms repeat for a set number of times (print ten times “hello”) or until a condition is met. (while num is less than 10 add one to num)