Browse Source

correct function

main
parent
commit
e02f658714
  1. 9
      src/main/quizproject.c
  2. 2
      src/main/quizproject.h

9
src/main/quizproject.c

@ -63,6 +63,12 @@ void displayInstructions(void) {
displayGoodLuckMessage(); 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 void looping(char qS[][100], char qC[][100], char aS[]){// 5
printf("\t\t--------------------Round 1-------------------\n\n"); 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); response = toupper(response);
if(response == aS[i]){ if(response == aS[i]){
score++; score++;
printf("\nCorrect!\n");
printf("You have %d points now\n\n", score);
correct(score);
} else { } else {
printf("\nwrong!\n"); printf("\nwrong!\n");

2
src/main/quizproject.h

@ -7,7 +7,7 @@ void displayLifelineInstructions(void);
void displayInstructions(void); void displayInstructions(void);
void displayGoodLuckMessage(void); void displayGoodLuckMessage(void);
void ask_questions(void); void ask_questions(void);
void correct(int);
int score = 0; int score = 0;
#endif #endif
Loading…
Cancel
Save