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.
Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.