Hi friends,do you know why the average exam points of each student are plus constantly itself? Please help me🙏🙏
public class ac{ public static void main(String[]args){ int[][]a={{62,98},{86,53},{64,87},{94,85},{96,65},{64,76}}; int sum=0; for(int i=0;i<a.length;i++){ int j=0; sum+=a[i][j]; } System.out.println("The average points of chinese exam="+ sum/a.length); for(int i=1;i<a.length;i++){ int j=1; sum+=a[i][j]; } System.out.println("The average of math examt="+ sum/a.length); int average=0; for(int i=0;i<a.length;i++){ for(int j=0;j<=1;j++){ average+=a[i][j];} System.out.println("The average points of " + (i+1) + "student are "+ average/2); } } } The problem come out over here👆👆👆👆👆👆👆,the last for loop of the program.