Waveprint error

#include
using namespace std;

int main()
{
int n=3,m=4;
int row,col;
int a[3][4];

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

return 0;

// not able to find the error

hi @srivastavaayush1611_3fd51b257da0b834 take the input of 2d array also value for n and m dont hardcode it

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.