Created
December 11, 2018 19:04
-
-
Save ivanelson/626fa332b0c05a4f0e122694187cb0b3 to your computer and use it in GitHub Desktop.
Recebe 3 notas e calcula média de 04 alunos
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
int main(void) { | |
// declaração de variáveis | |
int contador; | |
float nota1, nota2, nota3, media; | |
for (contador = 0; contador < 3; contador ++) { | |
printf("\nDigite a primeira nota do aluno %d: ", contador + 1); | |
scanf("%f", ¬a1); | |
printf("\nDigite a segunda nota do aluno %d: ", contador + 1); | |
scanf("%f", ¬a2); | |
printf("\nDigite a terceira nota do aluno %d: ", contador + 1); | |
scanf("%f", ¬a3); | |
media = (nota1 + nota2 + nota3 ) / 3; | |
if (media > 6 ) | |
printf("\nAluno %d APROVADO! MEDIA -> %f ", contador, media); | |
else | |
printf("\nAluno %d REPROVADO! MEDIA -> %f ", media); | |
printf("\nVamos calcular a nota do próximo do aluno!!!"); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment