Q:

C program to make a beep sound

0

C program to make a beep sound

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

The "\a" escape sequence is used to make a beep sound i.e., it is used to generate a tone sound on the speaker. The beep sound can be used for the debugging or any other purpose.

Program:

The source code to make a beep sound is given below. The given program is compiled and executed using GCC compile on UBUNTU 18.04 OS successfully.

// C program to make beep sound

#include <stdio.h>

int main(int argc, char* argv[])
{
    printf("Beep sound started\n");
    printf("\a");
    printf("Beep sound stopped\n");

    return 0;
}

Output:

Beep sound started
Beep sound stopped

Explanation:

In the main() function, we used "\a" escape sequence to make a beep sound.

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

C programming Basic Input, Output, if else, Ternary Operator based Programs

Similar questions


need a help?


find thousands of online teachers now
C program to convert a given number of days into d... >>
<< C program to print all printable characters withou...