1
$\begingroup$
int main()
{
    int i,a[3][3];
    int diagonal_diff;

    int lsum=0,rsum=0;
    for(i=0;i<3;i++){
       lsum=lsum+a[i][i];
       rsum=rsum+a[i][2-i];
      }
     diagonal_diff= abs(lsum-rsum);
     printf("%d",diagonal_diff);

}

$\endgroup$
1
  • $\begingroup$ Hi, welcome to Data Science SE! Please improve your post by stating exactly what you get, why you think it's not what it should be, what you've tried and your question. $\endgroup$ Jan 12 '20 at 21:17

Browse other questions tagged or ask your own question.