Answer:
#include <stdio.h>
typedef struct TimeHrMin_struct //struct
{
int hours;
int minutes;
} TimeHrMin;
struct TimeHrMin_struct SetTime(int hoursVal,int minutesVal) //SetTime function
{
struct TimeHrMin_struct str;
str.hours=hoursVal; //assigning the values
str.minutes=minutesVal;
return str; //returning the struct
}
int main(void)
{
TimeHrMin studentLateness;
int hours;
int minutes;
scanf("%d %d", &hours, &minutes);
studentLateness = SetTime(hours, minutes); //calling the function
printf("The student is %d hours and %d minutes late.\n", studentLateness.hours, studentLateness.minutes);
return 0;
}
Explanation: