I was returning to programming in C, and I get this error when I was trying to compile the program:
error: conflicting types for 'getMedia'
I'm not finding the error below, first i was thinking that could be a type error, but is not the case, I've tried to declare the function above as global 'variable' but it not work.
Could someone help me?
#include <stdio.h>
#include <stdlib.h>
int main()
{
float nota1,nota2,nota3,nota4;
scanf("%f %f %f %f",¬a1,¬a2,¬a3,¬a4);
float media = getMedia(nota1,nota2,nota3,nota4);
if(media < 5.0 && media >= 0){
printf("Aluno reprovado\n");
}else if(media > 7 && media <= 10){
printf("Aluno aprovado\n");
}else{
checkExam();
}
}
float getMedia(float nota1,float nota2, float nota3, float nota4){
return (nota1*2+nota2*3+nota3*4+nota4)/10;
}