C Program to Calculate Difference Between Two Time Period ( HH: MM: SS ) Using Structure
What Is Structure
The structure is a user-defined data type in C which allows you to combine different data types Suppose you want to store a record of Student which consists of student name, address, roll number and age. You can define a structure to hold this information.
Defining a structure
struct keyword is used to define a structure. struct define a new data type which is a collection of different type of data.
Syntax :
struct structure_name
{
//Statements
};
Output:
Enter start time:
Enter hours, minutes and seconds respectively: 11 35 44
Enter stop time:
Enter hours, minutes and seconds respectively: 07 42 36
TIME DIFFERENCE: 11:35:44 - 7:42:36 = 3:53:8
need an explanation for this answer? contact us directly to get an explanation for this answer