2D Array

// 2D array
char[] ops = {'+', '-', '*', '/'};
int[][] numbers = {{60,50}, {40,30}, {20,10}};
for (char op : ops) {
    for (int i = 0; i < numbers.length; i++) {
        int result = calc(numbers[i][0], numbers[i][1], op);
        System.out.printf("result = %d %s %d = %d\n", numbers[i][0], op, numbers[i][1], result);
    }
}

result = 60 + 50 = 110
result = 40 + 30 = 70
result = 20 + 10 = 30
result = 60 – 50 = 10
result = 40 – 30 = 10
result = 20 – 10 = 10
result = 60 * 50 = 3000
result = 40 * 30 = 1200
result = 20 * 10 = 200
result = 60 / 50 = 1
result = 40 / 30 = 1
result = 20 / 10 = 2