dos.h

sleep c

Sleep function delays program execution for a given number of seconds.

Declaration: void sleep(unsigned seconds);

nosound c

nosound function turn off the PC speaker.

Declaration : void nosound();

sound c

Sound function produces the sound of a specified frequency. Used for adding music to c program, try to use some random values in loop, vary delay and enjoy.

Declaration:- void sound(unsigned frequency);

setdate c

setdate function is used to change system date.

Output: 
change system date

gettime c

gettime in c: gettime function is used to find current system time. We pass address of a structure varibale of type ( struct time ).

Output: 
system time

getdate c

Program to print the current system date, getdate c code below explain how to use this function to print computer date.

Getdate example

C programming code to print date

Output: 
system date

delay function in c

Delay in c: delay function is used to suspend execution of a program for a particular time.

Declaration :- void delay(unsigned int);

Here unsigned int is the number of milliseconds ( remember 1 second = 1000 milliseconds ). To use delay function in your program you should include the dos.h header file.

C programming code for delay

#include<stdio.h>
#include<stdlib.h>
 
main()
{
    printf("This c program will exit in 10 seconds.\n");        
 
    delay(10000);                         
 
    return 0;
}
Subscribe to RSS - dos.h
randomness