#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).