Advertisement
argentinapb

Untitled

Jul 2nd, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. struct data{
  4. int dia,mes,ano;
  5. };
  6.  
  7. struct aluno{
  8. int codigo,dia,mes,ano;
  9. char nome[50];
  10. double notas[5][2];
  11. };
  12. //Função para registrar Alunos;
  13. void inclusao(){
  14. int i=0,j,k;
  15.  
  16. printf("Codigo do aluno:\n");
  17. scanf("%d",&c[i].codigo);
  18. getchar();
  19.  
  20. printf("Nome do aluno:\n");
  21. gets(c[i].nome);
  22.  
  23. printf("Data de nascimento:\n");
  24. scanf("%d %d %d",&c[i].dia,c[i].mes,c[i].ano);
  25. //for para ler as notas;
  26. for(k=0;k<5;k++){
  27. for(j=0;j<2;j++){
  28. Printf("Nota da materia %d e da prova %d:\n",k,j);
  29. scanf("%lf",&c[i].notas[k][j]);
  30. }
  31. }
  32.  
  33. i++;
  34.  
  35.  
  36. }
  37.  
  38. int main (){
  39. int x;
  40. struct data var[10];
  41. struct aluno c[10];
  42. printf("1 Inclusao:\n");
  43. printf("2 Consulta:\n");
  44. printf("3 Alteracao:\n");
  45. printf("4 Exclusao de aluno:\n");
  46. scanf("%d",&x);
  47.  
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement