This code shows compilation error in my system can u pls correct the error in it

#include
using namespace std;
int main() {
int **arr;
int r,c;
cin>>r>>c;

//create an array of row heads
arr = new int*[r];

//create  an array of arrays or create 2d array
for(int i=0;i<r;i++){
    arr[i]= new int[c];
}

//take input and print the elements
int val =1;
for(int i=0;i<r;i++){
    for(int j=0;j<c;j++){
        arr[i][j] =val;
        val++;
        cout<<arr[i][j]<<" ";
    }
    cout<<endl;
}

return 0;

}

@Himanshukaushik1772 share your code using cb ide

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.