1 #include <stdio.h>
2 #include <ctype.h>
3 #include <conio.h>
4
5 void main()
6 {
7 char letter; // Letter typed by the user
8
9 printf("Do you want to continue? (Y/N): ");
10
11 letter = getch(); // Get the letter
12 letter = toupper(letter); // Convert letter to uppercase
13
14 while ((letter != 'Y') && (letter != 'N'))
15 {
16 putch(3); // Beep the speaker
17 letter = getch(); // Get the letter
18 letter = toupper(letter); // Convert letter to uppercase
19 }
20
21 printf("\nYour response was %c\n", letter);
22 }