Loops
Lesson 1 of 1
  1. 1

    A loop is a programming tool that repeats some code or a set of instructions until a specified condition is reached. As a programmer, you’ll find that you rely on loops all the time! You’ll h…

  2. 2

    So first up… the […] loop! Before we dive deep into the syntax of the […] loop, let’s do a demo. Inside enter_pin.cpp, we have a program that asks and checks for a password. It uses…

  3. 3

    So now that we got a demo of loops, let’s write one! The […] loop looks very similar to an […] statement. And just like an […] statement, it executes the code inside of it if the condi…

  4. 4

    The last one we held your hand, so let’s try one on your own. As an example of iteration, we have the first program ever to run on a stored-program computer (the EDSAC ). It was written and run b…

  5. 5
    ( FoxTrot ) Iterating over a sequence of numbers is so common that C++, like most other programming languages, has a special syntax for it. When we know exactly how many times we want to ite...
  6. 6

    In the last exercise, we saw an example of an incrementing […] loop so here we are going to show you how to write a […] loop where the counter goes down. When we know exactly how many times…

  7. 7

    Great job! Key concepts covered in this lesson: - Loops perform repetitive actions so we don’t have to code those actions manually every time. - How to write […] loops with a continue condi…

What you'll create

Portfolio projects that showcase your new skills

Pro Logo

How you'll master it

Stress-test your knowledge with quizzes that help commit syntax to memory

Pro Logo