#include <stdio.h>
int main() {
FILE *database;
struct person {
char name[80];
int age;
char sex;
int month;
int day;
int year;
}person[10];
int i;
for(i=0;i<=9;i++) {
printf("Enter the persons Name: ");
scanf("%s",&(person[i].name));
printf("Enter the person's Age: ");
scanf("%d",&(person[i].age));
printf("Enter the person's Sex (M or F): ");
scanf("%c",&(person[i].sex));
printf("Enter the person's Birth Date (DD/MM/YYYY): ");
scanf("%d/%d/%d",&(person[i].day),&(person[i].month),&(person[i].year));
}
database=fopen("database.dat","wb");
fwrite(person,sizeof(struct person),10,database);
return(0);
}