//CSC 220
//Spring 2009
//Assignment 2
//Author: Yibin Liao
#include <iostream>
//Prints a multiplication table
using namespace std;
//multiplication function
void multiply(int size, int j){
for (int i=1; i<=size; i++)
cout << i*j << "\t";
cout << endl;
}
main(){
int size;
int i,j;
//Prompt the user for the size the table should be
cout << "Table size is ";
cin >> size;
cout << endl;
cout << "*" << "\t";
//Print the first line of the table
for (i=1; i<=size; i++)
cout << i << "\t";
cout << endl;
//Print the first vertical line of the table and
//print the multiplicaton table
for (j=1; j<=size; j++){
cout << j << "\t";
multiply(size, j);
}
// keep the window open until a key is pressed
// by calling the windows command line program: pause
system("pause");
}