Chapter Overview
Explore fundamental C++ programming constructs such as standard input/output, variables, and loops. Learn step-by-step to write a program that prints multiplication tables and practice using loops through various exercises to build a strong coding foundation.
We'll cover the following...
“If I have seen further, it is by standing on the shoulders of giants.”
- Isaac Newton
In this chapter, we’ll solve a simple table printing problem by incrementally learning about the following basic constructs:
- Standard input/output (
cinandcout) - Mathematical expressions
- Variables
- Repetition using
while/forloop
Using the above constructs, we will learn to create a program that prompts the user for a number and prints that number’s table up to a certain limit (as shown below).
We will also solve several exercises involving loops and practice printing several sequences.
Let’s start by writing our first C++ program!