Arrays-Wave print Column Wise

I am getting below error:
TESTCASE # 1 : wrong-answer (Time: 0.14 s)
TESTCASE # 2 : wrong-answer (Time: 0.14 s)
TESTCASE # 3 : wrong-answer (Time: 0.15 s)
TESTCASE # 4 : wrong-answer (Time: 0.13 s)

import java.util.*;
public class Main {
public static void main(String args[]) {

    Scanner scn = new Scanner(System.in);
    int r = scn.nextInt();
    int c = scn.nextInt();
    int[][] m = new int[r][c];
     for(int i =0; i<r;i++)
                {
                     for(int j =0; j<c;j++){
                         m[i][j] = scn.nextInt();;
                     }
                }

    int y = 0;
    boolean x = true;
    while(y<c){
        
        if(x)
        {   
            for(int i =0; i<r;i++)
                System.out.print(m[i][y]+", ");
        }
        else{
            for(int i =r-1; i>=0;i--)
            System.out.print(m[i][y]+", ");
        }
        x =!x;
        y++;
    }

}

}

@Ans hey arun please send your code using coding blocks ide by saving your code on the server it would easier to debug asap.

I have save the code, can you check it now.

@Ans hey arun post the link of your code.

https://online.codingblocks.com/app/player/51089/content/34152/4825?tab=submissions

you can also check my last submission

@Ans hey arun this link is not accessible so please share your code on ide.codingblocks.com copy your code here and press save button it will generate a link that link you have to share here.

@Ans hey arun after the while loop end just print System.out.print(β€œEND”);