Pages

Friday, August 12, 2016

C program to ring a bell using ASCII value 7.


#include<stdio.h>
int main()
{
  //following printf will ring a beep sound.
          
  printf("%c", 7);
           
  // Note:7 is ASCII value of a beep sound.
  // Note:Use %c to ring a beep sound.
  return 0;
}


Output of Program:

You will listen a beep sound.

2 comments:

  1. Does this even work? I am using TURBO C.

    ReplyDelete
    Replies
    1. As 7 is ASCII value of Beep Sound, you will listen one beep sound for every one %c for ASCII 7. I have tried and its properly working on Windows 7, Dev C++ editor.

      Delete