Incorrect number of inputs while accessing array of type a[][1000]

#include
using namespace std;
int main()
{
cout<<“hello”;
int rows,col,arr[][1000]={0};
cin>>rows>>col;
cout<<“entered row and col”;

for(int i =0;i<rows;i++)
{
	for(int j=0;j<col;j++)
	cin>>arr[i][j];

}

cout<<"\nend";

for(int i =0;i<rows;i++)
{
for(int j=0;j<col;j++)
cout<<arr[i][j];
}

}

The above code runs perfectly fine at coding blocks ide but the array is not accepting the required number of inputs when the for loop is iterated using "rows " and col variable. however the desired input is obtained if I directly iterate the loop from 0 to 1,2… (a number rather than variable).

@Eshika please save your code on ide.codingblocks.com and share the link.

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.

hi @Eshika please share the code by saving it on CB IDE