diff --git a/src/main/quizproject.c b/src/main/quizproject.c index ef606e0..63fe338 100644 --- a/src/main/quizproject.c +++ b/src/main/quizproject.c @@ -821,6 +821,20 @@ void play_guessTheWord() { } + + +void B_show_time(void) { + time_t current_time; + struct tm *time_info; + char time_string[9]; + + time(¤t_time); + time_info = localtime(¤t_time); + + strftime(time_string, sizeof(time_string), "%H:%M", time_info); + printf("The current time is: %s\n", time_string); +} + void B_displayWelcomeMessage(void) { printf("\t\t------------------------------------------\n\n"); printf("\t\t------------------------------------------\n\n"); @@ -864,6 +878,7 @@ void b_epic_game() { B_username(); B_userinfo(); B_displayGameInstructions(); + B_show_time(); } diff --git a/src/main/quizproject.h b/src/main/quizproject.h index 8bcd341..5725d3f 100644 --- a/src/main/quizproject.h +++ b/src/main/quizproject.h @@ -52,6 +52,7 @@ int toupper(int _c); void B_sayhello(char name[]); void B_userinfo(void); void B_displayGameInstructions(void); +void B_show_time(void); #define NUM_QUESTIONS 5 #define round 3