Created
October 27, 2015 11:13
-
-
Save renoirtech/f3ecc6c8fc16bca5c261 to your computer and use it in GitHub Desktop.
Código que cria tabela de notas com média
This file contains 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
/* | |
+---------+---------+---------+---------+--------+ | |
| | 0 | 1 | 2 | 3 | | |
+---------+---------+---------+---------+--------+ | |
| | Nota1 | Nota2 | Nota3 | Media | | |
+---------+---------+---------+---------+--------+ | |
| | Nota1 | Nota2 | Nota3 | Media | | |
+---------+---------+---------+---------+--------+ | |
| | Nota1 | Nota2 | Nota3 | Media | | |
+---------+---------+---------+---------+--------+ | |
| | Nota1 | Nota2 | Nota3 | Media | | |
+---------+---------+---------+---------+--------+ | |
| | Nota1 | Nota2 | Nota3 | Media | | |
+---------+---------+---------+---------+--------+ | |
*/ | |
#include <stdio.h> | |
int main () { | |
//declaração de variaveis | |
int notas[5][3],l=0,c=0,media=0; | |
char aluno[5]; | |
//inserindo valores | |
for (l=0; l<4; l++) { | |
notas[l][3] = 0; | |
printf("\nCadastro do aluno %d:\n", l+1); | |
for (c=0; c<3; c++) { | |
printf("Digite a nota nº %d:\n", c+1); | |
scanf("%d", ¬as[l][c]); | |
notas[l][3] = notas[l][3] + notas[l][c]; | |
} | |
notas[l][3] = notas[l][3]/3; | |
printf("A média dessa fera é: %d", notas[l][3]); | |
} | |
}//fim do programa |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment