Print a multiplication table
Print the first 10 multiples of a given integer in equation form.
Course progress
Problem 15 of 100
Example → approach → runnable solution
Worked example
See the problem in action
Trace a concrete input through to the verified result.
Example input
number = 7; multipliers = 1 through 10
Expected output
7 x 1 = 7 7 x 2 = 14 7 x 3 = 21 7 x 4 = 28 7 x 5 = 35 7 x 6 = 42 7 x 7 = 49 7 x 8 = 56 7 x 9 = 63 7 x 10 = 70
What is happening?
Multiply 7 by each integer from 1 through 10, producing one equation per line from 7 x 1 = 7 to 7 x 10 = 70.
Solution strategy
Build the right mental model
Loop from 1 through 10 and multiply the input by the current counter for each line.
Core concepts
loops · formatted output
Complexity
Time O(1) for 10 fixed rows, space O(1).
Runnable solution
Learn from working code
Compare languages, copy the code, or open it in the compiler.
Complete C# solution for multiplication-table
using System;
class Program
{
static void Main()
{
int number = 7;
for (int multiplier = 1; multiplier <= 10; multiplier++)
Console.WriteLine(number + " x " + multiplier + " = " + number * multiplier);
}
}Knowledge check
Questions students often ask
What is the main idea behind print a multiplication table?
Loop from 1 through 10 and multiply the input by the current counter for each line.
What is the time and space complexity of this solution?
Time O(1) for 10 fixed rows, space O(1).
Do all language tabs solve the same problem?
Yes. Every program uses the same example and produces the verified output shown on this page. The syntax and a few language-specific data structures differ.