#include <stdio.h>
void main()
{
int i = 0,j=0;
int sum = 0;
int a[3][3] = {{1,2,3},{4,5,6},{7,8,9}};
for(i = 0;i < 3;i++)
for(j=0;j<3;j++)
{if(i=j)
sum=sum=a[i][j];
else if(i+j==2)
sum=sum+a[i][j];
}
printf("%d\n",sum);
}
void main()
{
int i = 0,j=0;
int sum = 0;
int a[3][3] = {{1,2,3},{4,5,6},{7,8,9}};
for(i = 0;i < 3;i++)
for(j=0;j<3;j++)
{if(i=j)
sum=sum=a[i][j];
else if(i+j==2)
sum=sum+a[i][j];
}
printf("%d\n",sum);
}