Guest User

Untitled

a guest
Dec 14th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.61 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3.     typedef struct{
  4.         float trab[4],prova[2];
  5.         int matricula;
  6.     }tipoaluno;
  7.  
  8.     int main (){
  9.    
  10.     tipoaluno aluno[3];
  11.     int i,j;
  12.  
  13.     for(i=0; i<=2; i++){
  14.        
  15.         printf("Informe a matricula no %d aluno\n", i+1);
  16.         scanf("%d", &aluno[i].matricula);
  17.        
  18.         for (j=0;j<4;j++){
  19.             printf("Informe a nota do %d aluno no %d trabalho\n", i+1, j+1);
  20.             scanf("%f", &aluno[i].trab[j]);
  21.         }
  22.    
  23.         for (j=0;j<2;j++){
  24.             printf("Informe a nota do %d aluno na %d prova\n", i+1, j+1);
  25.             scanf("%f", &aluno[i].prova[j]);
  26.         }
  27.     }
  28.    
  29.     for (i=0;i<3;i++)
  30.         printf("Teste: %d", aluno[i].matricula);
  31.     return 0;
  32. }
Add Comment
Please, Sign In to add comment