In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
//assuming x[row][column]
//s is squares, sr is square root, return value is diagonal elements
int calculate(int *x[10][10], int *s, int *sr) {
int i,j,k, sum=0;
*s=0; *sr=0;
for(i=0,j=9;i<10;i++ ,j--){
sum+=*x[i][i]+*x[i][j];
for(k=0;k<9;k++) if(i%2) *s+=*x[i][k]**x[i][k]; else *sr+=sqrt(*x[k][i]);
}
return(sum-=*x[4][4]);
}