WAIT_YN.C
上传用户:qq5388545
上传日期:2022-07-04
资源大小:29849k
文件大小:1k
- #include <stdio.h>
- #include <ctype.h>
- #include <conio.h>
- void main()
- {
- char letter; // Letter typed by the user
- printf("Do you want to continue? (Y/N): ");
- letter = getch(); // Get the letter
- letter = toupper(letter); // Convert letter to uppercase
-
- while ((letter != 'Y') && (letter != 'N'))
- {
- putch(7); // Beep the speaker
- letter = getch(); // Get the letter
- letter = toupper(letter); // Convert letter to uppercase
- }
- printf("nYour response was %cn", letter);
- }