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(b1000);
            b += 60;
        } while (b != 660);
        b = 660;
        do
        {
            Beep(b1000);
            b -= 60;
        } while (b != 120);

    case 2:
    {
        while (!kbhit())
        {
            do
            {
                Beep(b1000);
                b += 60;
            } while (b != 660);
            b = 660;
            do
            {
                Beep(b1000);
                b -= 60;
            } while (b != 60);
        }
    }
    }
}

Comments

Popular posts from this blog

Hand cricket Game in C language - source code ( Program 15)

Program to find largest of 3 numbers in C language (Program 08)