diff --git a/CiscoQuestion.java b/CiscoQuestion.java new file mode 100644 index 0000000..55ebc99 --- /dev/null +++ b/CiscoQuestion.java @@ -0,0 +1,37 @@ +public class CiscoQuestion { + public static void main(String[] args) { + // 51 24 36 + // 43 55 67 + // 95 54 28 + + int[][] neo = { { 251, 424, 136 }, { 743, 655, 676 }, { 895, 854, 828 } }; + int temp = neo[0][0]; + int minColumn = 0; + int MaxNum = neo[0][0]; + for (int i = 0; i < neo.length; i++) { + System.out.println(""); + for (int j = 0; j < neo[i].length; j++) { + System.out.print(neo[i][j]); + System.out.print("\t"); + if (neo[i][j] < temp) { + temp = neo[i][j]; + minColumn = j; + } + } + } + System.out.println("The smallest Number in the matrix is: " + temp + " at column: " + minColumn); + // let's check the highest number in that column + // + int x = 0; + while (x < 3) { + if (neo[x][minColumn] > MaxNum) { + MaxNum = neo[x][minColumn]; + } + x++; + + } + + System.out.println("The highest number on the minClumn is: " + MaxNum + "!"); + + } +}