Hello! It's OK? I'm having a problem when I run my program, it's a program to calculate four means and divide by four, and it's necessary to do this using If and Else, but when I execute, the program reads the first condition, and if the input of if Else the program reads normally, but when the "Student" is approved the program executes the printf of APPROVED and then executes the Printf of REPROVADO, being that if it was approved, it was not to execute the reprobate. Can someone help me?
#include <stdio.h>
#include <conio.h>
int main () {
//VARIAVEIS
float media, nota1, nota2, nota3, nota4, recMedia, receberec;
printf("\n VAMOS CALCULAR SUA NOTA\n");
printf("\nPRESSIONE ENTER...\n");
getch();
//ENTRADA DE DADOS
printf("\n---------------------------\n");
printf("\nDIGITE SUA PRIMEIRA NOTA\n");
scanf("%f", ¬a1);
printf("\nDIGITE SUA SEGUNDA NOTA\n");
scanf("%f", ¬a2);
printf("\nDIGITE SUA TERCEIRA NOTA\n");
scanf("%f", ¬a3);
printf("\nDIGITE SUA QUARTA NOTA\n");
scanf("%f", ¬a4);
printf("\n---------------------------\n");
printf("\nPRESSIONE ENTER PARA CALCULAR\n");
getch();
//ENTRADA DE PROCESSAMENTO
printf("\nPRONTO JA VALIDAMOS SUA MEDIA!\nQUE RUFEM OS TAMBORES...\n");
media = (nota1+nota2+nota3+nota4)/4;
printf("\nSUA MEDIA:\t%.2f", media);
printf("\n---------------------------\n");
if (media>=7) {
printf("\n\tAPROVADO!\n%.2f", media);
}
else {
printf("\n\tREPROVADO!\n");
printf("\nINSIRA SUA NOTA DE EXAME:");
scanf("%f",&recMedia);
printf("\nMEDIA DE EXAME:\t\n%.2f", recMedia);
}
receberec = (recMedia+media)/2;
if (receberec>=7) {
printf("\n\tAPROVADO EXAME!\n%.2f", receberec);
}
else {
printf ("\n\tREPROVADO EXAME!\n%.2f", receberec);
}
printf("\n---------------------------\n");
getch();
printf("\nFIM\n");
system ("PAUSE");
return (0);
}