Question: Define a function SetBirth, with int parameters monthVal and dayVal, that returns a struct of type BirthMonthDay. The function should assign BirthMonthDay's data member month
Define a function SetBirth, with int parameters monthVal and dayVal, that returns a struct of type BirthMonthDay. The function should assign BirthMonthDay's data member month with monthVal and day with dayVal.
#include
typedef struct BirthMonthDay_struct {
int month;
int day;
} BirthMonthDay;
/* Your solution goes here */
int main(void) {
BirthMonthDay studentBirthday;
int month;
int day;
scanf("%d %d", &month, &day);
studentBirthday = SetBirth(month, day);
printf("The student was born on %d/%d.", studentBirthday.month, studentBirthday.day);
return 0;
}
Step by Step Solution
There are 3 Steps involved in it
To implement the SetBirth function that assigns values to a BirthMonthDay struct you need to define ... View full answer
Get step-by-step solutions from verified subject matter experts
