MCPcopy Create free account
hub / github.com/Manvityagi/PW-Skills-Java-Course-Codes / main

Method main

Lecture 22/src/PrintSpiral.java:47–65  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

printMatrixMethod · 0.95
printSpiralOrderMethod · 0.95

Tested by

no test coverage detected