The problem you have is in the loops. In the loop:
the n=0 sets n equal to 0 therefore ignoring the input entirely. The same goes for the for loop with m as the subject.Code:for (n=0; n<height; n++)
Try removing the for loops entirely and see what response you get from the code, I.E.
Code:int main () { do { cout << "Enter n: "; cin >> n; cout << "Now m: "; cin >> m; arr[n][m]=(n+1)*(m+1); cout << arr[n][m] << "\n"; } while (n != 2); return 0; }




Reply With Quote