afive309.c

来自「学习C语言必备的好书」· C语言 代码 · 共 23 行

C
23
字号
/*****************************************************/
/*sound函数 和 nosound函数                           */
/*函数原型: void sound(unsigned int frequendcy);     */
/*          void nosound(void);                      */
/*函数功能:                                          */
/*    函数sound的功能是使PC喇叭以指定的频率发声。函数*/
/*nosound的功能是关闭PC喇叭,停止发声。              */
/*    其中函数sound的参数frequendcy为指定的发声频率, */
/*单位为赫兹。                                       */
/*****************************************************/
/*sound,nosound例程*/
#include <dos.h>

int main(void)
{
   sound(700);
   delay(500);
   sound(1500);
   delay(1000);
   nosound();
   return 0;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?