Advertisement
Glaas2

Agenda

Feb 11th, 2015
303
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.46 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. typedef struct Registro{
  5.        char nombre[15];
  6.        char apellidos[25];
  7.        char direccion[40];
  8.        char cod_pos[8];
  9.        char tel[15];
  10.        char email[30];
  11.        char facebook[30];  
  12.        }registro;
  13.  
  14. main()
  15. {
  16. int exit=0, i, num;
  17.  
  18. do
  19.  {
  20.  printf("Ingrese el numero de registros a ingresar: ");
  21.  scanf("%d", &num);
  22.  registro reg[num];
  23.   for(i=0;i<num;i++)
  24.   {
  25.    printf("Ingrese el nombre: ");
  26.    setbuf(stdin, NULL);
  27.    gets(reg[i].nombre);
  28.    printf("Ingrese los apellidos: ");
  29.    setbuf(stdin, NULL);
  30.    gets(reg[i].apellidos);
  31.    printf("Ingrese el direccion: ");
  32.    setbuf(stdin, NULL);
  33.    gets(reg[i].direccion);
  34.    printf("Ingrese el codigo postal: ");
  35.    setbuf(stdin, NULL);
  36.    gets(reg[i].cod_pos);
  37.    printf("Ingrese el telefono: ");
  38.    setbuf(stdin, NULL);
  39.    gets(reg[i].tel);
  40.    printf("Ingrese el email: ");
  41.    setbuf(stdin, NULL);
  42.    gets(reg[i].email);
  43.    printf("Ingrese el facebook: ");
  44.    setbuf(stdin, NULL);
  45.    gets(reg[i].facebook);
  46.    }
  47.  
  48.  for(i=0;i<num;i++)
  49.   {
  50.    printf("\n\n");
  51.    printf("Nombre: %s \n", reg[i].nombre);
  52.    printf("Apellidos: %s\n", reg[i].apellidos);
  53.    printf("Direccion: %s\n", reg[i].direccion);
  54.    printf("Codigo Postal: %s\n", reg[i].cod_pos);
  55.    printf("Telefono: %s\n", reg[i].tel);
  56.    printf("Email: %s\n", reg[i].email);
  57.    printf("Facebook: %s\n", reg[i].facebook);
  58.    printf("\n\n");
  59.   }
  60.  
  61. exit=1;
  62.  }while(exit!=1);
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement