#include <stdio.h>
#include <stdlib.h>>
#include <math.h>
#include "Time.h"
void elapsedTime(struct time time1, struct time time2); // Prototype
int main(){
struct time time1 = {3, 45, 15};
struct time time2 = {9, 44, 03};
elapsedTime(time1, time2);
return 0;
}
void elapsedTime(struct time time1, struct time time2){
int elapsedTime = ((time1.Hours * MINUTES_IN_AN_HOUR *
SECONDS_IN_A_MINUTE) + (time1.Minutes * SECONDS_IN_A_MINUTE) +
time1.Seconds) - ((time2.Hours * MINUTES_IN_AN_HOUR *
SECONDS_IN_A_MINUTE) + (time2.Minutes * SECONDS_IN_A_MINUTE) +
time2.Seconds);
printf(" %d \n", abs(elapsedTime));
return;
}
struct time{
int Hours;
int Seconds;
int Minutes;
};