int row,col;
cout << "please input how many rows and columns you want accordingly: ";
cin>>row>>col;
//create array in heap.
int **arr=new int*[row];
for(int i=0;i<row;i++)
{
arr[i]=new int[col];
}
//getting value from user.
for(int i=0;i<row;i++)
{
for(int j=0;j<col;j++)
{
cout<<"Enter a number ";
cin>>arr[i][j];
}
}
//display Elements.
for(int i=0;i<row;i++)
{
for(int j=0;j<col;j++)
{
cout<<arr[i][j]<<" ";
}
}
return 0;