MCPcopy Create free account
hub / github.com/PrajaktaSathe/Java / printDiagonal

Method printDiagonal

Programs/SortNonBoundary.java:79–97  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

77 }
78 }
79 void printDiagonal()
80 {
81 int sum = 0;
82 for(int i=0;i<m;i++)
83 {
84 for(int j=0;j<m;j++)
85 {
86 if(i==j || (i+j)==m-1)
87 {
88 System.out.print(A[i][j]+"\t");
89 sum = sum + A[i][j];
90 }
91 else
92 System.out.print("\t");
93 }
94 System.out.println();
95 }
96 System.out.println("Sum of the Diagonal Elements : "+sum);
97 }
98 public static void main(String args[])
99 {
100 SortNonBoundary ob = new SortNonBoundary();

Callers 1

mainMethod · 0.95

Calls 1

printMethod · 0.80

Tested by

no test coverage detected