Home Format Memory Card Best Rangoli Designs Earn Money on Net Make A Blog Popular

C++ program to generate a beep sound from the PC speaker

C++ program to generate beep sound. Here for this purpose dos.h header file is used. In this program sound() function, delay() function and nosound() function are used.This program will generate beep sound from the PC speaker.
#include<iostream.h>
#include<conio.h>
#include<dos.h>
main()
{
clrscr();
sound(500); // 500 is frequency
delay(1000); // time delay in milliseconds
nosound(); // it will stop the sound
getch();
}

0 comments: