Learn C: Beeping sound – “\a”

This entry is part 6 of 7 in the series Learn C

This is a character (\a) that will play the beeping sound from your computer.

#include <stdio.h>

void main()
{
     printf("\a");
     printf("\a");
     printf("\a");
     printf("Beep, beep, beep.");
     printf("\n");
}

Try the above program and make sure that you can hear the 3 beeping sounds.

beep

Series Navigation<< Learn C: Special Characters
Learn C: Using Visual Studio to compile a C program >>