Question1 1 pt Consider the following program #include #include typedef struct c
ID: 3709749 • Letter: Q
Question
Question1 1 pt Consider the following program #include #include typedef struct char first [100]; char last[10] Name; typedef struct Name name; double gpa; Student; int main(void) Student s; You want to initialize the variable s to refer to a student with the first name "John", the last name "Doe", and who has a 4.0 GPA. What lines of code must you add after the first line in the main function? ?s.gpa = 4.0: 1 ? 5->gpa. 4.0: strcpy(name.first, John) d strcpyls.last, "Doe ? strcpy(s.namelast. "Doe''); a strepy(s.name.first, John"Explanation / Answer
int main(void) { Student s; strcpy(s.name.first, "John"); strcpy(s.name.last, "Doe"); s.gpa = 4.0; } /*Note that order of statement does not matter * strcpy(s.name.first, "John"); strcpy(s.name.last, "Doe"); s.gpa = 4.0; but they should be written with each other */
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.