Advertisement
FAMDS

3

Nov 15th, 2022
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <conio.h>
  3. #include <locale.h>
  4. int
  5. main ()
  6. {setlocale(LC_ALL, "Portuguese");
  7. struct aluno
  8. {
  9. char nome[100];
  10. char matricula[10];
  11. char curso[30];
  12. };
  13.  
  14. typedef struct aluno aluno;
  15.  
  16. int i = 0;
  17. aluno a[5];
  18.  
  19. for (i = 0; i < 5; i++)
  20. {
  21. printf ("Informe a matricula: ");
  22. fflush (stdin);
  23. fgets (a[i].matricula,10,stdin);
  24.  
  25. printf ("Informe o nome: ");
  26. fflush (stdin);
  27. fgets (a[i].nome,100,stdin);
  28. printf ("Informe a curso: ");
  29. fflush (stdin);
  30. fgets (a[i].curso,30,stdin);
  31.  
  32. }
  33. for (i=0; i<5; i++){
  34. printf ("\tMatricula .....: %s\t", a[i].matricula);
  35. printf ("Nome .........: %s\t", a[i].nome);
  36. printf ("Curso ....: %s\n", a[i].curso);
  37. }
  38.  
  39. return 0;
  40. }
  41.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement