Loops – multiplication table

We will create two example programs to demonstrate loops that both will produce multiplication tables.

In the first program, we will ask the user for the multiplier and generate the multiplication table for that value from 0 to 10, which is defined as a macro MULT_LIMIT . Notice, that the loop condition uses  <=  – this means that the ending value is inclusive, which is typically not what we would want, but in this case we do.

In the second example, we will take a look at nested loops and produce a full multiplication table from 1 to 10.

Notice, that contrary to usual, the starting value of the counters is 1 and the ending value is again inclusive. Also notice the location of the line change and padding the answers with spaces! Think what and when is being done with the printf()  statements!