Sound Function in C or C++

In Both C and C++:
--------------------------------------
#include<dos.h>
#include<iostream.h>
 void main()
{
   int a;
   for ( a = 200 ; a <= 1000 ; a = a + 20 )
   {
      sound(a);
      delay(25);
   }
   nosound();
}

------------------------------------------
You can also do like that in C++ :

#include<iostream.h>
#include<conio.h>
void main()
{
cout<<"\a --------- \a -------- \a";
getch();
}

--------------------------------------
You can also do like that in C Language :

#include<stdio.h>
#include<conio.h>
void main()
{
printf("\a --------- \a -------- \a");
getch();
}










No comments

Powered by Blogger.