Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- typedef struct Registro{
- char nombre[15];
- char apellidos[25];
- char direccion[40];
- char cod_pos[8];
- char tel[15];
- char email[30];
- char facebook[30];
- }registro;
- main()
- {
- int exit=0, i, num;
- do
- {
- printf("Ingrese el numero de registros a ingresar: ");
- scanf("%d", &num);
- registro reg[num];
- for(i=0;i<num;i++)
- {
- printf("Ingrese el nombre: ");
- setbuf(stdin, NULL);
- gets(reg[i].nombre);
- printf("Ingrese los apellidos: ");
- setbuf(stdin, NULL);
- gets(reg[i].apellidos);
- printf("Ingrese el direccion: ");
- setbuf(stdin, NULL);
- gets(reg[i].direccion);
- printf("Ingrese el codigo postal: ");
- setbuf(stdin, NULL);
- gets(reg[i].cod_pos);
- printf("Ingrese el telefono: ");
- setbuf(stdin, NULL);
- gets(reg[i].tel);
- printf("Ingrese el email: ");
- setbuf(stdin, NULL);
- gets(reg[i].email);
- printf("Ingrese el facebook: ");
- setbuf(stdin, NULL);
- gets(reg[i].facebook);
- }
- for(i=0;i<num;i++)
- {
- printf("\n\n");
- printf("Nombre: %s \n", reg[i].nombre);
- printf("Apellidos: %s\n", reg[i].apellidos);
- printf("Direccion: %s\n", reg[i].direccion);
- printf("Codigo Postal: %s\n", reg[i].cod_pos);
- printf("Telefono: %s\n", reg[i].tel);
- printf("Email: %s\n", reg[i].email);
- printf("Facebook: %s\n", reg[i].facebook);
- printf("\n\n");
- }
- exit=1;
- }while(exit!=1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement