Question: Write a function in c , called age _ difference ( ) that takes two Person variables as parameters and returns the difference in age
Write a function in c called agedifference that takes two Person variables as parameters and returns the difference in age in years as an integer.
Suppose that Person is defined as follows:
typedef struct
char name;
int birthyear;
Person;
If two people were defined as
Person y Greg;
Person b Anthony;
Then agedifferencey b should return agedifference should always return a positive value or zero.
Please note: you should not write a main function. Assume that all necessary #include statements, the main function, and the printf statements to display output have all been implemented. You should write only the agedifference function.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
