60 626
Assignments Done
97,8%
Successfully Done
In April 2018

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
Expert's answer
#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 first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions