(String[] args)
| 45 | } |
| 46 | |
| 47 | public static void main(String[] args) { |
| 48 | Scanner sc = new Scanner(System.in); |
| 49 | System.out.println("Enter number of rows and columns of matrix"); |
| 50 | int r = sc.nextInt(); |
| 51 | int c = sc.nextInt(); |
| 52 | int[][] matrix = new int[r][c]; |
| 53 | int total = r * c; |
| 54 | System.out.println("Enter " + total + " values"); |
| 55 | for (int i = 0; i < r; i++){ |
| 56 | for(int j = 0; j < c; j++){ |
| 57 | matrix[i][j] = sc.nextInt(); |
| 58 | } |
| 59 | } |
| 60 | System.out.println("Input Matrix"); |
| 61 | printMatrix(matrix); |
| 62 | |
| 63 | System.out.println("Spiral Order"); |
| 64 | printSpiralOrder(matrix, r, c); |
| 65 | } |
| 66 | } |
| 67 |
nothing calls this directly
no test coverage detected