text: /*
  @@@@ PROGRAM NAME: knkcch16e06.c
  @@@@ FLAGS: -std=c99
  @@@@ PROGRAM STATEMENT: 
  Write the following function, assuming that the time structure contains three members:
  hours, minutes, and seconds (all of type int).
  
  	struct time split_time(long total_seconds) ;
  
  total_seconds is a time represented as the number of seconds since midnight. The
  function returns a structure containing the equivalent time in hours (0-23), minutes (0-59),
  and seconds (0-59).
  */
  #include<stdio.h>
  //---------------------------------------------------------------------------
  //---------------------------------------------------------------------------
  struct time
  {
  	int hours, minutes, seconds;
  };
  //---------------------------------------------------------------------------
  struct time split_time(long total_seconds);
  //---------------------------------------------------------------------------
  //------------------------START OF MAIN()--------------------------------------
  int main(void)
  {
  	printf("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
  	
  	long total_seconds;
  
  	printf("Enter total seconds: ");
  	scanf("%ld", &total_seconds);
  
  	struct time t = split_time(total_seconds);
  
  	printf("Time (hh:mm:ss): %.2d:%.2d:%.2d", t.hours, t.minutes, t.seconds);
  
  	printf("\n++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
  	return 0;
  }
  //-------------------------END OF MAIN()---------------------------------------
  struct time split_time(long total_seconds)
  {
  	int h,m,s;
  	h = total_seconds / 3600 ;
  	m = (total_seconds % 3600) / 60 ;
  	s = total_seconds % 60 ;
  
  	return (struct time){h, m, s} ;
  }
  //---------------------------------------------------------------------------
  //---------------------------------------------------------------------------
  //---------------------------------------------------------------------------
  //---------------------------------------------------------------------------
  //---------------------------------------------------------------------------
  //---------------------------------------------------------------------------
  //---------------------------------------------------------------------------
  //---------------------------------------------------------------------------
  //---------------------------------------------------------------------------
  /*
  OUTPUT:
  @@@@ Trial1:
  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  Enter total seconds: 1321
  Time (hh:mm:ss): 00:22:01
  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  
  @@@@ Trial2:
  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  Enter total seconds: 12345
  Time (hh:mm:ss): 03:25:45
  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  @@@@ Trial3:
  @@@@ Trial4:
  @@@@ Trial5:
  @@@@ Trial6:
  @@@@ Trial7:
  @@@@ Trial8:
  @@@@ Trial9:
  */
  //---------------------------------------------------------------------------