What is the error in the code

#include
using namespace std;
int main()
{
int val;
int m,n;
cin>>m>>n;
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<<endl;

}
for(int col=0;col<n;col++)
{
	if(col%2==0)
	{
		for(int row=0;row<m;row++)
		{
			cout<<a[row][col]<<" ";
		}
	}
	else {
		for(int row=m-1;row>=0;row--)
		{
			cout<<a[row][col]<<" ";
		}
	}
}
return 0;

}

hello @shdanish1508,
a) u r not taking input . u r just hardcoding values in matrix
b)u need to print ,( comma) after printing each number and then in the last u need to print END ( please check sample input output)

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.