Question: Can someone please help me with my C code every time I run it in my terminal or run the program it skips over the

Can someone please help me with my C code every time I run it in my terminal or run the program it skips over the user entering there gender here is my code and here is the programming running if someone could help me as soon as possible thanks in advance.

Can someone please help me with my C code every time I

run it in my terminal or run the program it skips over

9 10 #include #include #include 12 typedef struct HealthProfile char name [20] int id; char gender: int day, month,year; float percentage; struct HealthProfile *p; 16 17 19 21 HealthProfileT; 22 void setName (HealthProfileT record) 23 printf("Enter Patient Name: ") scanf("%s", record->name); 25 7 void setId (HealthProfileT record) 28 29 30 printf("nEnter Patient ID: ") scanf ("%d" ,&record->id) ; 32 void setGender (HealthProfileT record) _flush(stdin); printf("Enter Patient Gender scanf("%c" ,&record->gender) ; 35 (M or F): "); 37 38 void setDOB (HealthProfileT record) 39 printf("nEnter Patient Day of Birth (1-31): ") scanf("%d",&record->day) ; printf("nEnter Patient Month of Birth(1-12): " scanf("%d",&record->month) ; printf("Enter Patient Year of Birth: ") scanf("%d" ,&record->year) ; 47 int main() HealthProfileT *ptr= malloc ( sizeof (HealthProfileT)); setName (ptr); setId(ptr); setGender(ptr) setDOB (ptr); printf(" Name : \t%s ", ptr->name); printf("ID:\t%d ", ptr->id); printf("Gender:\t%c ", ptr->gender); printf( "DOB: \t%d-%d-%d\b ", ptr->day, ptr->month, ptr->year) ; return 0 50 52 57 ip-168-26-83-39:documents nivealindsay$./HealthProfile Enter Patient Name: Nivea Enter Patient ID: 200 Enter Pati M or F) Enter Patient Day of Birth(1-31): 19 ent Gender Enter Patient Month of Birth(1-12): 86 Enter Patient Year of Birth: 1995 Name Nivea ID: Gender 200 DOB: 19-6-1991p-168-26-83-39 : documents nivealindsay$

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!