Answer to Question #61808 in C++ for jimboy

Question #61808
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;
}

cout << endl;
}

return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS