Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.74 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. main () {
  5.   char nome[10][30];
  6.   float a1[10],a2[10],cal[10];
  7.   int x;
  8.   //entrada
  9.   for(x=0 ; x<10 ; x++) {
  10.     printf("Digite o nome do %d aluno: ",x+1);
  11.     fflush(stdin);
  12.     gets(nome[x]);
  13.     printf("Digite a nota A1: ");
  14.     scanf("%f", &a1[x]);
  15.     }
  16.     printf("Digite a nota A1: ");
  17.     scanf("%f", &a2[x]);
  18.     }
  19.     cal[x] = (a1[x]+a2[x])/2;
  20.   }
  21.   //exibição
  22.   for(x=0 ; x<10 ; x++) {
  23.     printf("\nAluno: %s\n", nome[x]);
  24.     printf("Nota A1: %.2f\n", a1[x]);
  25.     printf("Nota A2: %.2f\n", a2[x]);
  26.     printf("Media: %.2f\n", cal[x]);
  27.     if(cal[x] < 6)
  28.       printf("Status: Reprovado\n");
  29.     else
  30.       printf("Status: Aprovado\n");
  31.   }
  32.   system("pause");
  33.   return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement