#include <stdio.h>
int main(){
int a[3][3],i,j,b[3][3],k,c[3][3];
int sum;
for(i=0;i<3;i=i+1)
{ for(j=0;j<3;j=j+1)
{ scanf("%d",&a[i][j]);}}
for(i=0;i<3;i=i+1)
{ for(j=0;j<3;j=j+1)
{ if (i==j)
{ sum=sum+a[i][j];}}}
printf("%d",sum);}
To embed this project on your website, copy the following code and paste it into your website's HTML: