Les dejo un ejercicio que les puede servir para realizar el trabajo práctico

#include <stdio.h>
#include <conio.h>
#include <windows.h>
struct socios{
int nro;
char nombre[20];
char apellido[20];
int edad;
};
void main (void)
{
struct socios jugadores[20];
int i;
int cant=0;

int opcion;
while (opcion!=3){
system(«cls»);
printf(«la cantidad de datos es %d\n»,cant);
printf(«1 – Cargar datos\n»);
printf(«2 – Mostrar datos\n»);
printf(«3 – Salir\n»);
scanf(«%d»,&opcion);

if (opcion==1){
printf(«Cargar datos la estructura\n»);
_sleep(300);
i=cant;
printf(«cargando el socio en el registro %d\n»,i+1);
printf(«ingrese el nro de socio»);
scanf(«%d»,&jugadores[i].nro);
printf(«ingrese el Nombre»);
scanf(«%s»,&jugadores[i].nombre);
printf(«ingrese el apellido»);
scanf(«%s»,&jugadores[i].apellido);
printf(«ingrese la edad»);
scanf(«%d»,&jugadores[i].edad);
printf(«Jugador cargado\n»);
_sleep(200);
system(«cls»);
cant++;
};
if (opcion==2){
//Mostrar datos en una estructura
printf(«Listado de socios\n\n»);
printf(«Nro\t Nombre\t Apellido\t edad\t\n»);
for (i=0;i<cant;i++){
printf(«%d\t %s\t %s\t\t %d \n»,jugadores[i].nro,jugadores[i].nombre,jugadores[i].apellido,jugadores[i].edad);
};
printf(«fin del listado»);
getch();
_sleep(300);
};
}

}

enlace para descargar

A %d blogueros les gusta esto: