I made this guessing game program. I want it to ask the user after he/she gets the correct answer if they want continue or play again... then the user will select an answer Y for yes, N for no, and the game will loop again. I know it's simple but I can't seem to get it!!! I've been trying for a while now! HELP!Code:#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main()
{
char answer;
int guess;
int tries;
int number;
srand(time(0));
number=rand()%20;
printf("This is a guessing game! The computer will choose a number from 1-20, try to guess the number!\n");
printf("Enter your first guess!\n");
scanf("%d", &guess);
if (guess > 20)
printf("That guess is over 20!\n");
for (tries=1; guess != number;tries++)
{
if (guess > number)
printf("Wrong! %d is greater than the secret number!\n",guess);
if (guess < number)
printf("Wrong! %d is less than the secret number!\n",guess);
printf("Enter another guess!\n");
scanf("%d", &guess);
if (guess > 20)
printf("That guess is over 20!\n");
}
if(tries ==1)
printf("Amazing! You got it on your first guess!\n");
if(tries ==2)
printf("Excellent! It took you only 2 tries!\n");
if(tries ==3)
printf("Good job! It took you 3 tries\n!");
if(tries ==4)
printf("Pretty good! It took you 4 tries. Now try to beat this record!\n");
if (tries >=5)
printf("Not bad! It took 5 or more guesses!\n");
return 0;
}