C++ program to demonstrate example of delay() function
delay(unsigned int milliseconds)
delay() function is used to hold the program's execution for given number of milliseconds, it is declared in dos.h header file.
Syntax:
void delay(unsigned int milliseconds)
Here, void is the return type of the function that means delay() will not return any value, and unsigned int milliseconds is the number of milliseconds to hold the program, delay() function accept unsigned int type of value.
Consider the program:
This program is compiled and run on TurboC3 compiler, in this program: there are delays of 1000 milliseconds (1 second) between printing of "www.", "nerdutella." and ".com" then another delay to reach to getch() statement.
After that you will have to press any key to reach return 0; and program’s control will be returned (exit from program).
Output
There are 1 second (1000 milliseconds) delays between printing of "www.", "nerdutella." and ".com"
need an explanation for this answer? contact us directly to get an explanation for this answer