#include <iostream>
usingnamespace std;
int main (){
int x;
int y;
int a;
int b;
cout << "insert first number ";
cin >> a;
cout << "insert second number ";
cin >> b;
int asd[a][b];
for(x=1;x<a;x++){
for(y=1;y<b;y++)asd[x][y]=x*y;
}
for(x=1;x<a;x++){
for(y=1;y<b;y++)cout << x << "*" << y << "=" << asd[x][y] << " ";
cout << "\n";
}
system("pause");
return 0;
}
I would be surprised if this actually ran, have you tried compiling it? When declaring arrays you need a constant expression (a real number) you cannot use a variable to create an array, because your compiler needs to know the amount of memory it needs to store at compile time.
And the way you want to multiply in your second example no there isn't although if in the case you want to just multiply the two numbers they enter instead of adding them like in the first example you put up you just simply need to change the plus to a multiplication sign.