For loop multiplication tables

I am supposed to use a for loop to call a function into main that first asks for a range of 2 numbers, then makes multiplication tables that multiply the first number by 0-12 as well as all the numbers in between the first number and the second number. I cannot figure out how to arrange the for loop so that it will do this. I have my code so far attached, but have no idea where to go from what I have or if I am even headed in the right direction. Any sort of help would be appreciated.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include <iostream>
#include <iomanip>
 
using namespace std;

void table(int num1, int num2, int multiplier);

int main()
{
	int num1, num2, multiplier;
	cout << "Enter two numbers for your range of multiplication tables: ";
	cin >> num1, num2;

	while (num1 > num2)
	{
		cout << "ERROR, number 1 must be less than number 2." << endl;
		cout << "Enter a different second number that's greater than " << num1 << ": " << endl;
		cin >> num2;
	}
	
	for (multiplier = 0; multiplier <= 12; multiplier++)
	{
		table(num1, num2, multiplier);
	}
	for (int difference = num1; num1 <= num2; difference++)
		{
			int total2 = multiplier * difference;
			cout << left << setw(3) << difference << " * " << setw(3) << multiplier << " = " << total2 << endl;
		}
	
	
	return 0;
}

void table(int num1, int num2, int multiplier)
{
	int total = multiplier * num1;
	cout << left << setw(3) << num1 << " * " << setw(3) << multiplier << " = " << total << endl;
	
}
  

I got the for loop to do a multiplication table for the first number I enter, but am confused on how to continue to get multiplication tables for the numbers in between up until my second number...
also, where do I place my for loops so that this works?
for (int difference = num1; num1 <= num2; difference++) change to
for (int difference = num1; difference<= num2; difference++)
Topic archived. No new replies allowed.