Question #15915

Make and run a program that will let the user to input two numbers. Display a multiplication table using entered numbers as its size. Set maximum size to 20.

Expert's answer

#include <iostream>

using namespace std;

int main (){

int n,m;

cout<<"Enter two number\n";

cin>>n>>m;

if (n > 20 || m > 20) cout<< "Input uncorrect!\n";

else

for (int i = 0 ; i < n ; i++){

& for (int j = 0 ; j < m ; j++)

& {

& cout<< i+1<<"*" << j+1 << "="<< (i+1)*(j+1)<<" quot;;

& }

& cout<<endl;

}

system("pause");

return 0;

}

using namespace std;

int main (){

int n,m;

cout<<"Enter two number\n";

cin>>n>>m;

if (n > 20 || m > 20) cout<< "Input uncorrect!\n";

else

for (int i = 0 ; i < n ; i++){

& for (int j = 0 ; j < m ; j++)

& {

& cout<< i+1<<"*" << j+1 << "="<< (i+1)*(j+1)<<" quot;;

& }

& cout<<endl;

}

system("pause");

return 0;

}

Learn more about our help with Assignments: C++

## Comments

## Leave a comment