Point me the error in the following code. I can't give the inputs

#include
using namespace std;

int main(){
int a[1000][1000] = {0};
int m, n;
cin >> m >> n;

//iterate over the array
int val = 1;
for (int row = 0; row <= m-1; row++){
    for (int col = 0; col <= n-1; col++){
        a[row][col] = val;
        val = val + 1;
        cout << a[row][col] << " ";
    } 
    cout << '\n';
}

}

Hi @adityakaunhai your code is working fine on the ide, what exactly is the problem?
https://ide.codingblocks.com/s/196735 I have saved your code here, you can see the output for the given input is correct.

when i run build the code in codeblocks it doesn’t gives any error but when i run the code the console opens and says stopped working

Hi @adityakaunhai is your codeblocks ide working properly? You can check by a simple cin, cout statement first. Your code is completely fine, seems like your ide is not configured properly or some other technical issue. Which input are you giving on your computer? I will check for that also.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.