Question: This is my C language assignment. Please help me to solve this. Thank you. Exercise 14 B #include #include File name: ex14b.c #define NAME_LEN 100

This is my C language assignment. Please help me to solve this. Thank you.

This is my C language assignment. Please help me to solve this.

Exercise 14 B #include #include File name: ex14b.c #define NAME_LEN 100 /* the length of file name */ int main(void) { /*...*/ /* declare a file pointer fp*/ int i; Task: please complete the program in the next page. One of execution examples is also shown in this page. The purpose of the program is for saving the input data from keyboard into a given file. /* input data is name, length, and weight */ char name[NAME_LEN]; /* name */ double height; /* height */ double weight; /* weight */ Be careful, the file (hw2.dat) should be in the same directory/folder as the program. /*...*/ /* open the file and return to the file pointer fp, the file name is "hw2.dat"*/ if (*...*/) printf("\a The file "%s\ doesn't exist. , hw2.dat"); else{ /* add data into the file */ for (i = 0; ; i++){ int flag; printf(Please input the data of the No. %d person (Yes, .... 1 / Finished, .... 0 ", i + 1); scanf("%d", &flag); if (flag == 0) break; a.out ex 14a.c ex14b.c hw2.dat yuyanbyus-Macair Ex14 %/a.out Please input the data of the No. 1 person (Yes, ... 1 / Finished, ....) 1 Name: Yu Height : 166 Weight: 55 Please input the data of the No. 2 person (Yes, ... 1 / Finished, ....) yuyan Yus-MacAir Ex14 % printf("Name: "); scanf (*...*/); printf("Height: "); scanf /*...*)); printf("Weight: "); scanf /*...*/); /* add the data into the file */ } /*...*/ /* close the file */ return 0; 21 }

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!