#include
using namespace std;
int main() {
int N,M;
cin>>N>>M;
int A[N][M];
for(int i=0; i<N; i++)
{
for(int j=0; j<M; j++)
cin>>A[i][j];
}
for(int i=0; i<N; i++)
{
for(int j=0; j<M; j++)
cout<<A[j][i]<<" ";
}
cout<<βENDβ<<endl;
return 0;
}
Why is my code not showing any output for the question Arrays-Wave print Column Wise
hey @AyushKumar9032 you have to print a WAVE coulmn wise do not have to print whole array column wise.WAVE means for 1st column go from top to bottom then for 2nd column go from bottom to top and again top to bottom like this, means you have to make it look like wave.
sorry i got it in the loop else part inside that j loop condition is j<=0 which should be j>=0
1 Like