-
Notifications
You must be signed in to change notification settings - Fork 0
/
Empleado.c
44 lines (42 loc) · 857 Bytes
/
Empleado.c
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
36
37
38
39
40
41
42
43
44
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "Empleado.h"
#include "Empresa.h"
///CARGAR
struct empleado cargarEmpleado(){
struct empleado p;
printf("\nNombre del empleado: ");
fflush(stdin);
gets(p.nombre);
printf("\nEdad:");
scanf("%i", &p.edad);
printf("\nPuesto:");
fflush(stdin);
gets(p.puesto);
system("cls");
return p;
};
void cargarEmpleados(struct empleado e[]){
int i;
for(i=0;i<5;i++){
e[i]=cargarEmpleado();
}
}
///MOSTRAR
void mostrarEmpleados(struct empleado e[], int cant){
int j;
printf("\n");
system("pause");
system("cls");
for(j=0;j<cant;j++){
mostrarEmpleado(e[j]);
printf("\n\n");
}
}
void mostrarEmpleado(struct empleado e){
printf("\n...EMPLEADO...");
printf("\nNombre: %s", e.nombre);
printf("\nEdad: %i", e.edad);
printf("\nPuesto: %s",e.puesto);
}