Browse Source

Added Hint function

main
fdlt3885 2 years ago
parent
commit
9ad02724a6
  1. 16
      src/main/quizproject.c
  2. 1
      src/main/quizproject.h

16
src/main/quizproject.c

@ -96,6 +96,13 @@ void looping(char qS[][100], char qC[][100], char aS[]){// 5
scanf(" %c", &response); scanf(" %c", &response);
response = toupper(response); response = toupper(response);
} }
else if (response == 'H') {
hint(i);
printf("Enter your answer (A, B, C, or D): ");
scanf(" %c", &response);
response = toupper(response);
}
if(response == aS[i]){ if(response == aS[i]){
score++; score++;
@ -128,9 +135,12 @@ void ask_questions(void) {
} }
void hint(int question_num) {
char qC[][100] = {//6
"The Tallest mountain is 8,849m."
};
printf("%s\n",qC[question_num]);
}
int main(){ int main(){
displayInstructions(); displayInstructions();

1
src/main/quizproject.h

@ -8,6 +8,7 @@ void displayInstructions(void);
void displayGoodLuckMessage(void); void displayGoodLuckMessage(void);
void ask_questions(void); void ask_questions(void);
void fifty_fifty(int); void fifty_fifty(int);
void hint(int);
void correct(int); void correct(int);
void wrong(int); void wrong(int);
int score = 0; int score = 0;

Loading…
Cancel
Save