Professional Documents
Culture Documents
COM SCI PROG Test
COM SCI PROG Test
h>
#include <string.h>
#include <stdlib.h>
/*Function Declaration */
int AddRecords();
struct TeacherRecord{
char Name[30];
int Age;
char Date_of_Birth[30];
char Subject_Taught[30];
char Gender[30];
char Team[30];
char Ethnicity[30];
}teacherRecords;
int main(){
printf("\t\t\t\t=====TEACHER AND STUDENT DATABASE MANAGEMENT SYSTEM=====\n");
AddRecords();
int AddRecords()
if(file = NULL){
printf("Error in writing File");
return 1;
while(1){
scanf("%d",&s1.Name);
scanf("%s",&s1.Age);
scanf("%lf",&s1.Date_of_Birth);
scanf("%f",&s1.Subject_Taught);
scanf("%g",&s1.Gender);
scanf("%a",&s1.Team);
scanf("%b",&s1.Ethnicity);
fprintf(file,"%d\n%s\n%lf\n%f\n%g\n%g\n%a\n
%b\n",&s1.Name,&s1.Age,&s1.Date_of_Birth,&s1.Subject_Taught,&s1.Gender,&s1.Team,s1.Ethnicity);
char ch = getchar();
break;
fclose(file);
return 0;