B
beginner10
Hello!
Can anyone help me? This code doesnt work. Where is the problem?
Inside the files mata and matb there is (should be) 10*10 matrix. It
should count a sum to new matrix. It does not work. Where is the problem?
#include <stdio.h>
main()
{
int first_matrix[10][10] ;
int second_matrix[10][10];
int sum_matrix=0;
int y, x;
int a, b;
printf("Matrix sum is saved in sum.usr file! %d\n", sum_matrix);
FILE *mata; mata = fopen("mata.txt", "w");
FILE *matb; matb = fopen("matb.txt", "w");
FILE *sum; sum = fopen("sum.usr", "w");
for(y = 0; y < 1; y++) {
for(x = 0; x < 1; x++) {
sum_matrix = first_matrix[y][x] + second_matrix[a];
printf("%d ", sum_matrix);
if(x == 4) {
}
}
}
}
Can anyone help me? This code doesnt work. Where is the problem?
Inside the files mata and matb there is (should be) 10*10 matrix. It
should count a sum to new matrix. It does not work. Where is the problem?
#include <stdio.h>
main()
{
int first_matrix[10][10] ;
int second_matrix[10][10];
int sum_matrix=0;
int y, x;
int a, b;
printf("Matrix sum is saved in sum.usr file! %d\n", sum_matrix);
FILE *mata; mata = fopen("mata.txt", "w");
FILE *matb; matb = fopen("matb.txt", "w");
FILE *sum; sum = fopen("sum.usr", "w");
for(y = 0; y < 1; y++) {
for(x = 0; x < 1; x++) {
sum_matrix = first_matrix[y][x] + second_matrix[a];
printf("%d ", sum_matrix);
if(x == 4) {
}
}
}
}