Please check the program: In [10] [10] Calculate the sum of the positive elements of the matrix above the main diagonal. B - real numbers
#include <stdio.h> #include <conio.h> #include <math.h> int main() { float i,j,B[10][10],s; s=0; printf("vv elementy matritsy B:\n"); for (i=0;i<10;i++) for (j=0;j<10;j++) scanf("%d",&B[i][j]); printf("martitsa B:\n"); for (i=0;i<10;i++) { for (j=0;j<10;j++) printf("%d\t",B[i][j]); printf("\n");} for (i=0;i<10;i++) { for (j=0;j<10;j++) if(i<j) s=s+B[i][j]; } printf("s=%d",s); getch(); }