Question: How do I create an algorithm using a loop that will add all the values in all odd columns, and print their total aligned below
How do I create an algorithm using a loop that will add all the values in all odd columns, and print their total aligned below the column. Should look like this:

What i have so far:
public class ArrayMath { public static void main(String[] args) { //Creating an two Dimensional Array int arr[][]=new int[10][10]; //calling the method by passing the array as argument arrays(arr); } private static void arrays(int[][] arr) { //Declaring variables int sumOfOddCols=0; int sumofAllElements=0; //Populating the elements into the 2-D array for(int i=0;i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
