how can a modfiy this source code to a menu.

#include <stdio.h>
#include <stdlib.h>
#include <time.h>

main()

{

char cYesNo = '\0';
int iResp1 = 0;
int iResp2 = 0;
int iResp3 = 0;
int iElaspedTime = 0;
int iCurrentTime = 0;
int iRandomNum = 0;
int i1 = 0;
int i2 = 0;
int i3 = 0;
int iCounter = 0;

srand(time(NULL));

printf("\nPlay a game of Concentration? (y or n):");
scanf("%c", &cYesNo);

if (cYesNo == 'y' || cYesNo == 'Y'){

i1 = rand() % 100;
i2 = rand() % 100;
i3 = rand() % 100;

printf("\nConcentrate on the next three numbers\n");
printf("\n%d\t%d\t%d\n" , i1, i2, i3);

iCurrentTime = time(NULL);

do {

iElaspedTime = time(NULL);
} while ( (iElaspedTime - iCurrentTime) < 3 ); //end do while loop

system("clear");

printf("\nEnter each # separted with one space: ");
scanf("%d%d%d", &iResp1, &iResp2, &iResp3);

if ( i1 == iResp1 && i2 == iResp2 && i3 == iResp3);
printf("\nCongratulations!\n");

} else

printf("\nSorry, correct numbers were %d%d%d\n" , i1, i2, i3);

}//end if

}//end main function

To modify this source code to create a menu, you can do the following steps:

1. Define a variable to hold the user's menu choice.
2. Use a loop to display the menu and get the user's choice.
3. Inside the loop, use a switch statement to call the appropriate function based on the user's choice.
4. Create separate functions for each menu option.
5. Update the main function to call the appropriate function based on the user's choice.

Here is an example of how the modified source code might look:

```c
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

void playGame();
void quit();

int main() {
char choice;

do {
printf("\nMenu:");
printf("\n1. Play a game of Concentration");
printf("\n2. Quit");
printf("\n\nEnter your choice (1-2): ");
scanf(" %c", &choice);

switch(choice) {
case '1':
playGame();
break;
case '2':
quit();
break;
default:
printf("\nInvalid choice. Please try again.");
}

} while(choice != '2');

return 0;
}

void playGame() {
char cYesNo = '\0';
int iResp1 = 0;
int iResp2 = 0;
int iResp3 = 0;
int iElaspedTime = 0;
int iCurrentTime = 0;
int iRandomNum = 0;
int i1 = 0;
int i2 = 0;
int i3 = 0;

srand(time(NULL));

printf("\nPlay a game of Concentration? (y or n): ");
scanf(" %c", &cYesNo);

if (cYesNo == 'y' || cYesNo == 'Y'){

i1 = rand() % 100;
i2 = rand() % 100;
i3 = rand() % 100;

printf("\nConcentrate on the next three numbers\n");
printf("\n%d\t%d\t%d\n" , i1, i2, i3);

iCurrentTime = time(NULL);

do {

iElaspedTime = time(NULL);
} while ( (iElaspedTime - iCurrentTime) < 3 ); //end do while loop

system("clear");

printf("\nEnter each number separated with one space: ");
scanf("%d%d%d", &iResp1, &iResp2, &iResp3);

if ( i1 == iResp1 && i2 == iResp2 && i3 == iResp3)
printf("\nCongratulations!\n");
else
printf("\nSorry, correct numbers were %d %d %d\n" , i1, i2, i3);
}
}

void quit() {
printf("\nThank you for playing. Goodbye!\n");
}
```

In this modified code, the main function contains a do-while loop that displays the menu options and calls the appropriate function based on the user's choice. The 'playGame' function handles the game logic, while the 'quit' function simply displays a goodbye message and exits the program.