Generating Time Table in C#

Learn how to create a times table function in C# that generates a times table for a given number with a specified number of rows.

Let's say that we want to help our child learn their times tables, so we want to make it easy to generate a times table for a number, such as the 77 times table:

Press + to interact
1x 7 = 7
2 x 7 = 14
3 x 7 = 21
...
10 x 7 = 70
11 x 7 = 77
12 x 7 = 84

Most timetables have either 1010, 1212, or 2020 rows, depending on how advanced the child is. We learned about the for statement, so we know that it can be used to generate repeated lines of output when there is a regular pattern, such as a ...