You are viewing a single comment's thread. Return to all comments →
int primDig=0; int secDig=0; for(int i=0; i < n; i++){ primDig+=a[i][i]; secDig+=a[i][n-1-i]; } System.out.println(Math.abs(primDig-secDig));
Seems like cookies are disabled on this browser, please enable them to open this website
Diagonal Difference
You are viewing a single comment's thread. Return to all comments →