Beep() function in C with Examples
The Beep function in C is used to make a Beep sound. It generates a tone on the speaker. The function is synchronous, i.e. it waits and doesn’t return to its caller function until the sound is finished. It can be very useful during the Debugging process for finding errors.
Parameters: This method accepts two parameters:
- x: which is the frequency of sound
- y: which is the duration in ms till sound is ON.
- If the function produces the sound then it return any nonzero value.
- If the function doesn’t produces the sound then it returns zero.
Below is the illustration of the BEEP() function:
Note: The program won’t produce the sound in online IDE. Please try to run it in offline compilers.
Want to learn from the best curated videos and practice problems, check out the C Foundation Course for Basic to Advanced C.