Write a Visual C++ program that will display a multiplication table based on inputs coming from the user.
Sample Output:
Input no. of row(s): 4
Input no. of column(s): 5
1 2 3 4 5
2 4 6 8 10
3 6 9 12 15
4 8 12 16 20
1
Expert's answer
2016-09-07T09:14:03-0400
#include <iostream> #include <iomanip>
using namespace std;
int main() { int row, col;
cout << "Input no. of row(s): "; cin >> row; cout << "Input no. of column(s): "; cin >> col;
for (int i = 1; i <= row; i++) { for (int j = 1; j <= col; j++) { cout << setw(4) << i * j; }
Comments
Leave a comment