![Delay In Dev C++ Delay In Dev C++](https://developercommunity.visualstudio.com/storage/attachments/56180-capture.png)
Delay in C: delay function is used to suspend execution of a program for a particular time.
Oct 07, 2008 The problem is that i don't use Visual C, I use Borland C 5.0. Surely you can access the Windows standard library with any C or C compiler? Sleep is a basic windows function accessible from both compilers. The point is the 'sleep' is not an available function in standard C. If you want it available, go to a newsgroup that deals with. May 17, 2013 This 'effect' is called delay. Delay is a more professional term used for some thing that happens a little later than it is expected to happen. This is used in c intentionally to either create an 'effect' or to easy the procedures of the application for the user. Like there are many uses of the delay function.
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 which is not a part of standard C library.
Delay in C program
If you don't wish to use delay function then you can use loops to produce delay in a C program.
#include<stdio.h>int main()
{
int c, d;
for(c =1; c <=32767; c++)
for(d =1; d <=32767; d++)
{}
return0;
}
{
int c, d;
for(c =1; c <=32767; c++)
for(d =1; d <=32767; d++)
{}
return0;
}
We have not written any statement in the loop body. You may write some statements that doesn't affect logic of the program.
C programming code for delay
#include<stdio.h>#include<stdlib.h>
Delay In Dev C++
main()
{
printf('This C program will exit in 10 seconds.n');
{
printf('This C program will exit in 10 seconds.n');
delay(10000);
return0;
}
}
Delay No Dev C++
This C program exits in ten seconds, after the printf function is executed the program waits for 10000 milliseconds or 10 seconds and then it terminates.