Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- main () {
- char nome[10][30];
- float a1[10],a2[10],cal[10];
- int x;
- //entrada
- for(x=0 ; x<10 ; x++) {
- printf("Digite o nome do %d aluno: ",x+1);
- fflush(stdin);
- gets(nome[x]);
- printf("Digite a nota A1: ");
- scanf("%f", &a1[x]);
- }
- printf("Digite a nota A1: ");
- scanf("%f", &a2[x]);
- }
- cal[x] = (a1[x]+a2[x])/2;
- }
- //exibição
- for(x=0 ; x<10 ; x++) {
- printf("\nAluno: %s\n", nome[x]);
- printf("Nota A1: %.2f\n", a1[x]);
- printf("Nota A2: %.2f\n", a2[x]);
- printf("Media: %.2f\n", cal[x]);
- if(cal[x] < 6)
- printf("Status: Reprovado\n");
- else
- printf("Status: Aprovado\n");
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement