-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8a179aa
commit 79d3a59
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#include <stdio.h> | ||
|
||
struct time_struct | ||
{ | ||
int hour; | ||
int minute; | ||
int second; | ||
}; | ||
|
||
int main() | ||
{ | ||
struct time_struct time; | ||
printf("Enter time in HH:MM:SS format: "); | ||
scanf("%d:%d:%d", &time.hour, &time.minute, &time.second); | ||
printf("Equivalent time: "); | ||
|
||
printf("%d:%d:%d\n", time.hour, time.minute, time.second); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#include <stdio.h> | ||
|
||
struct time_struct | ||
{ | ||
int hour; | ||
int minute; | ||
int second; | ||
}; | ||
|
||
void input_time(struct time_struct *time) | ||
{ | ||
printf("Enter time in HH:MM:SS format: "); | ||
scanf("%d:%d:%d", &time->hour, &time->minute, &time->second); | ||
} | ||
|
||
void print_time(struct time_struct time) | ||
{ | ||
printf("Equivalent time: "); | ||
printf("%d:%d:%d\n", time.hour, time.minute, time.second); | ||
} | ||
|
||
int main() | ||
{ | ||
struct time_struct time; | ||
input_time(&time); | ||
print_time(time); | ||
return 0; | ||
} |