#include <stdio.h>
Go to the source code of this file.
|
| #define | NM 50 |
| #define | NE 20 |
| #define | NC 10 |
|
| int | main (int argc, char *argv[]) |
◆ NC
◆ NE
◆ NM
◆ main()
| int main |
( |
int | argc, |
|
|
char * | argv[] ) |
Definition at line 14 of file Ejemplo034.c.
15{
17 int op, i, n;
18 char c;
19 n = 0;
20 do{
21 printf("Nombre: ");
22 i = 0;
23 do{
24 c = getchar();
26 }while(c!=10);
27 agenda[n].
nombre[i-1] =
'\0';
28
29
30 printf("Telefono: ");
31 scanf("%ld", &(agenda[n].telefono));
32 printf("Correo electronico: ");
33 scanf("%s", agenda[n].email);
34 n++;
35 printf("Ingresar otro contacto: ");
36 scanf("%d", &op);
37 do{
38 c = getchar();
39 }while(c!=10);
41 printf("Agenda.\n");
42 for(i=0; i<n; i++)
43 printf("%s, %ld, %s\n", agenda[i].nombre, agenda[i].telefono, agenda[i].email);
44 return 0;
45}