/*Keep sounding the bell unless 'Q' or 'q' is pressed */ #include #include main() { unsigned char data; clrscr(); printf("To Stop the Bell Sound Press Q or q Key\n"); do { while(!kbhit()) //keep sounding Bell unless a key is pressed print("%c",0x07); data=getch(); //get the key pressed } while(!(data=='q'||data=='Q'); //continue as long as it is not Q or q }