Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <conio.h>
- #include <locale.h>
- int
- main ()
- {setlocale(LC_ALL, "Portuguese");
- struct aluno
- {
- char nome[100];
- char matricula[10];
- char curso[30];
- };
- typedef struct aluno aluno;
- int i = 0;
- aluno a[5];
- for (i = 0; i < 5; i++)
- {
- printf ("Informe a matricula: ");
- fflush (stdin);
- fgets (a[i].matricula,10,stdin);
- printf ("Informe o nome: ");
- fflush (stdin);
- fgets (a[i].nome,100,stdin);
- printf ("Informe a curso: ");
- fflush (stdin);
- fgets (a[i].curso,30,stdin);
- }
- for (i=0; i<5; i++){
- printf ("\tMatricula .....: %s\t", a[i].matricula);
- printf ("Nome .........: %s\t", a[i].nome);
- printf ("Curso ....: %s\n", a[i].curso);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement