We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 984da51 commit a4fe7eeCopy full SHA for a4fe7ee
1 file changed
IBM1.java
@@ -1,5 +1,11 @@
1
-import java.util.*;
+/* Find maximum prime from diagonals of a matrix
2
+ * 7 8 9
3
+ * 4 5 6
4
+ * 1 2 3
5
+ * Max prime of two diagonal = 7
6
+ */
7
8
+import java.util.*;
9
public class IBM1 {
10
public static void main(String[]args)
11
{
@@ -41,7 +47,7 @@ public static void main(String[]args)
41
47
}
42
48
43
49
int count = 0, loop, num2=0;
44
- int num;
50
+ int num=0;
45
51
for(int i=0; i<p; i++)
46
52
53
dia[i]=dia1[i];
@@ -70,6 +76,6 @@ public static void main(String[]args)
70
76
num2 = num;
71
77
72
78
73
- System.out.println("Max Prime : "+num);
79
+ System.out.println("Max Prime : "+num2);
74
80
75
81
0 commit comments