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

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

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

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

#include <iostream>

using namespace std;

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

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

	int i = 1;
	while(i <= n)
	{
		cout << m << " * " << i << " = " << m * i << endl;
		i++;
	}
	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