Saturday, April 6, 2013

sound c

Sound function produces the sound of a specified frequency. Used for adding music to c program, try to use some random values in loop, vary delay and enjoy.
Declaration:- void sound(unsigned frequency);

C programming code for sound

#include<dos.h>
 
main()
{
   int a;
 
   for ( a = 200 ; a <= 1000 ; a = a + 20 )
   {
      sound(a);
      delay(25);
   }
   nosound();
 
   return 0;
}

No comments:

Post a Comment