/* Program 4.4.4 from C++ Programming Lecture notes  */

/* Author: Rob Miller and William Knottenbelt
   Program last changed: 30th September 2023    */

/* This program prints out times tables. */ 

#include <iostream>
using namespace std;

void print_tables(int smallest, int largest);

void print_times_table(int value, int lower, int upper);

int main()
{
	print_tables(1,10);
	
	/* rest of main program:
	   ...
	   ...
	*/
			
	return 0;
}

void print_tables(int smallest, int largest)
{
	int number;
	
	for (number = smallest ; number <= largest ; number++)
	{
		print_times_table(number,1,10);
		cout << endl;
	}
}


void print_times_table(int value, int lower, int upper)
{
	int multiplier;
		
	for (multiplier = lower ; multiplier <= upper ; multiplier++)
	{
		cout << value << " x " << multiplier << " = ";
		cout << value * multiplier << endl;
	}
}
