-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathtut30.c
More file actions
42 lines (31 loc) · 888 Bytes
/
tut30.c
File metadata and controls
42 lines (31 loc) · 888 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <stdio.h>
//Copyright Chelin Tutorials. All Rights Reserved
//http://chelintutorials.blogspot.com/
//Mas sobre Estructuras
struct contacto{
char nombre [40];
char direccion [80];
int edad;
long telefono;
}; //!!!!!!!!!!!!!;
//cambiando el nombre del tipo strct contacto
typedef struct contacto contacto_t;
int main(void){
contacto_t c1;
//recibo los valores por entrada del usuario
printf("Ingrese el nombre:");
fflush(stdin);
gets(c1.nombre);
printf("\ningrese la direccion:");
fflush(stdin);
gets(c1.direccion);
printf("\nIngrese la edad:");
fflush(stdin);
scanf("%d",&c1.edad);
printf("\nIngrese telefono:");
fflush(stdin);
scanf("%d",&c1.telefono);
//imprimo los valores
printf("Nombre: %s\nDirec: %s\nEdad: %d,\nTel: %d",c1.nombre,c1.direccion,c1.edad,c1.telefono);
return 0;
}