public class waveprint {
public static void main(String[] args) {
// TODO Auto-generated method stub
int[][]arr= {{11,12,13,14},{21,22,23,24},{31,32,33,34},{41,42,43,44}};
printrow(arr);
}
public static void printrow(int[][]arr) {
for(int i=0;i<=arr.length;i++)
{
if(i%2==0)
{
for(int j=0;j<=arr.length;j++)
{
System.out.println(arr[i][j]+" ");
}
}
else
{
for(int j=arr.length;j<=0;j--)
{
System.out.println(arr[i][j]+" ");
}
}
}
}
}