Sum of Each Column

Given a 3×3 matrix the task is to sum individual column of the matrix.

Example: Consider the 3×3 matrix

196
235
714

Sum of Column 1: 10

Sum of Column 2: 13

Sum of Column 3: 15

Java
import java.util.*;
class SumEachColumn
{
    public static void main(String args[])
    {
        int sum=0;
        Scanner sc=new Scanner(System.in);
        int ar[][]=new int[3][3];
        System.out.println("Enter matrix elements:-");
        for(int i=0;i<3;i++)
        {
            for(int j=0;j<3;j++)
            {
                ar[i][j]=sc.nextInt();
            }
        }
        for(int i=0;i<3;i++)
        {
            for(int j=0;j<3;j++)
            {
                sum=sum+ar[j][i];
            }
            System.out.println("Sum of Column "+(i+1)+": "+sum);
            sum=0;
        }
    }
}
Java