diff --git a/src/main/quizproject.c b/src/main/quizproject.c index 46c20ac..81a4ca1 100644 --- a/src/main/quizproject.c +++ b/src/main/quizproject.c @@ -63,6 +63,12 @@ void displayInstructions(void) { displayGoodLuckMessage(); } +void correct(int score2){ + printf("\nCorrect!\n"); + printf("You have %d points now\n\n", score); +} + + void looping(char qS[][100], char qC[][100], char aS[]){// 5 printf("\t\t--------------------Round 1-------------------\n\n"); @@ -76,8 +82,7 @@ void looping(char qS[][100], char qC[][100], char aS[]){// 5 response = toupper(response); if(response == aS[i]){ score++; - printf("\nCorrect!\n"); - printf("You have %d points now\n\n", score); + correct(score); } else { printf("\nwrong!\n"); diff --git a/src/main/quizproject.h b/src/main/quizproject.h index 14efb66..ed964a0 100644 --- a/src/main/quizproject.h +++ b/src/main/quizproject.h @@ -7,7 +7,7 @@ void displayLifelineInstructions(void); void displayInstructions(void); void displayGoodLuckMessage(void); void ask_questions(void); - +void correct(int); int score = 0; #endif