Pages

Wednesday, October 21, 2009

Code implementing police siren in 'c' language...


#include"stdio.h"
#include"conio.h"
#include"dos.h"
#include"stdlib.h"
void main()
{
    int i;
    float num;
    clrscr();
    printf("\nEnter a float number less than 2:");
    scanf("%f",&num);
    printf("\n\n\n\t\t\tPOLICE POLICE RUN......\n\t\t\t\tRUN>>>>>>");
    while(!kbhit())
    {
        for(i = 500;i < 2500 && !kbhit();i++)
        {
            sound(i);
            delay(num);

        }
    }
    nosound();
    getch();
}

No comments:

Post a Comment