class Er
{
public static void main(String[] args)
{
int[] [] arr={{1,2,3,4},{5,6,7,8},{9,8,7,6}};
int x=er(arr);
System.out.println(x);
}
public static int er(int[] [] arr)
{
int sum = 0;
for(int x=0;x<arr.length;x++)
{
for(int y=0;y<arr[x].length;y++)
{
sum=sum+arr[x][y];
//return sum;
}
}
return sum;
}
}
|