Swap the columns

Report a typo

Given a two-dimensional array (matrix) and the two numbers: i and j. Swap the columns with indexes i and j within the matrix.

Input contains matrix dimensions n and m, not exceeding 100, then the elements of the matrix, then the indexes i and j.

Sample Input 1:

3 4
11 12 13 14
21 22 23 24
31 32 33 34
0 1

Sample Output 1:

12 11 13 14
22 21 23 24
32 31 33 34
Write a program in Java 17
class Main {
public static void main(String[] args) {
// put your code here
}
}
___

Create a free account to access the full topic