sleep in C
Sleep function delays program execution for a given number of seconds.
Declaration: void sleep(unsigned seconds);
C programming code for sleep
#include <dos.h>
Sleep function delays program execution for a given number of seconds.
Declaration: void sleep(unsigned seconds);
Function nosound turn off the PC speaker.
Declaration: void nosound();
Sound function produces the sound of a specified frequency. Used for adding music to a C program, try to use some random values in loop, vary delay and enjoy.
Declaration: void sound(unsigned frequency);
setdate function is used to change system date.
gettime in c: gettime function is used to find current system time. We pass address of a structure varibale of type ( struct time ).
Program to print current system date, getdate C code below explain how to use this function to print computer date.
C programming code to print date
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.
main()
{
printf("This C program will exit in 10 seconds.\n");
delay(10000);
return 0;
}