Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Informix Database Administrators Survival Guide

Authors: Joe Lumbley

1st Edition

0131243144, 978-0131243149

More Books

Students also viewed these Databases questions

Question

Which are non projected Teaching aids in advance learning system?

Answered: 1 week ago

Question

3. Define the roles individuals play in a group

Answered: 1 week ago