C++ Program to Print Multiplication Table of m up to n using For Loop

C++ Program to Print Multiplication Table of m up to n using For Loop

Write C++ Program to Print Multiplication Table of m up to n using For Loop

// CPP Program to Print Multiplication Table of m up to n using For Loop

#include <iostream>

using namespace std;

int main()
{
	int m, n, i;
	cout << "Enter m :--> ";
	cin >> m;

	cout << "Enter n :--> ";
	cin >> n;

	for(i= 1; i <= n; i++)
	{
		cout << m << " * " << i << " = " << m * i << endl;
	}
	return 0;
}

Output:

Enter m :--> 7
Enter n :--> 13
 7 * 1 = 7
 7 * 2 = 14
 7 * 3 = 21
 7 * 4 = 28
 7 * 5 = 35
 7 * 6 = 42
 7 * 7 = 49
 7 * 8 = 56
 7 * 9 = 63
 7 * 10 = 70
 7 * 11 = 77
 7 * 12 = 84
 7 * 13 = 91