C Pogram to play Sa-re-ga......sa wihout break (Program 25)
/*
Made by Anmol main
Student :B.tech CSE
Punjabi university Patiala
Program No. : 25
*/
#include <stdio.h>
#include <conio.h>
#include <windows.h>
int main()
{
int a;
int b = 240;
printf("Press 1 to play Only 1 time \n: ");
printf("Press 2 to play untill you press a button \n: ");
scanf("%d", &a);
switch (a)
case 1:
{
do
{
Beep(b, 1000);
b += 60;
} while (b != 660);
b = 660;
do
{
Beep(b, 1000);
b -= 60;
} while (b != 120);
case 2:
{
while (!kbhit())
{
do
{
Beep(b, 1000);
b += 60;
} while (b != 660);
b = 660;
do
{
Beep(b, 1000);
b -= 60;
} while (b != 60);
}
}
}
}
Comments