- Code: Select all
#include <iostream>
#include <windows.h>
using namespace std;
int main ()
{
int number;
int count;
for (number=0; number<10; number++) //this loop will run up to 10 times then stop
{
for (count=220; count<=415; count++) //frequency will start at 220Hz and end at 415Hz increasing one Hz at a time
{
Beep(count,5); //lengh of beep in milisecounds
}
for (count=415; count>=220; count--)//frequency will play downwards from 415Hz to 220Hz
{
Beep(count,5);
}
}
return 0; //end of program
}
