-1
I am trying to make this program read the first 4 columns and calculate the final note and the average, but I cannot put the correct solution in the arithmetic mean.
#include <stdio.h>
#include <iostream>
int main(){
int i,j, M[5][5], maior;
float mediafinais=0;
for(i=0;i<2;i++){
printf("\n\nNumero da Matricula [%d] : ",i );
scanf("%d", &M[i][0]);
printf("Nota Av1: ");
scanf("%d", &M[i][1]);
printf("Nota Av2: ");
scanf("%d", &M[i][2]);
printf("Media dos trabalhos : ");
scanf("%d", &M[i][3]);
printf("Nota Final: %d", M[i][1] + M[i][2] + M[i][3]);
}
maior=M[0][3];
int al=0;
for(i=0;i<2;i++){
if(maior<M[i][3]){
maior=M[i][3];
al=i;
}
}
printf("\n A Maior Nota Final e do aluno com a matricula :");
printf(" %d \n\n",M[al][0]);
printf("\n\nMedia aritmetica das notas finais: %.2f ", mediafinais);
}
ta have any compilation error? execution? what’s your problem??
– rLinhares